public static bool ContainsProcessedRibbonId(CustomUIAttribute attribute, string ribbonid) { if (null != attribute && null != attribute.RibbonIDs) { return(attribute.RibbonIDs.Any(e => e == ribbonid)); } else { return(false); } }
/// <summary> /// IRibbonExtensibility implementation /// </summary> /// <param name="ribbonID">target ribbon id</param> /// <returns>XML content or String.Empty</returns> protected internal virtual string OnGetCustomUI(string ribbonID) { var ribbon = NetOffice.Attributes.AttributeExtensions.GetCustomAttribute <CustomUIAttribute>(Type); if (null != ribbon && ribbon.RibbonIDs.Contains(ribbonID)) { return(ReadString(CustomUIAttribute.BuildPath(ribbon.Value, ribbon.UseAssemblyNamespace, Type.Namespace))); } else { return(string.Empty); } }
/// <summary> /// IRibbonExtensibility implementation /// </summary> /// <param name="RibbonID">target ribbon id, only used from Outlook and ignored in this standard impklementation. overwrite this method if you need a custom behavior</param> /// <returns>XML content oder string.Empty</returns> public virtual string GetCustomUI(string RibbonID) { try { CustomUIAttribute ribbon = AttributeHelper.GetRibbonAttribute(Type); if (null != ribbon) { return(ReadRessourceFile(ribbon.Value)); } else { return(string.Empty); } } catch (System.Exception exception) { NetOffice.DebugConsole.WriteException(exception); RaiseErrorHandlerMethod(ErrorMethodKind.GetCustomUI, exception); return(string.Empty); } }
public virtual string GetCustomUI(string RibbonID) { try { CustomUIAttribute ribbon = AttributeReflector.GetRibbonAttribute(Type, RibbonID); if (null != ribbon) { return(Utils.Resource.ReadString(CustomUIAttribute.BuildPath(ribbon.Value, ribbon.UseAssemblyNamespace, Type.Namespace))); } else { return(string.Empty); } } catch (System.Exception exception) { NetOffice.DebugConsole.Default.WriteException(exception); OnError(ErrorMethodKind.GetCustomUI, exception); return(string.Empty); } }