コード例 #1
0
 protected override string OnGetCustomUI(string ribbonID)
 {
     try
     {
         OlCustomUIAttribute olRibbon = GetOlRibbonAttribute(Type, ribbonID);
         if (null != olRibbon)
         {
             return(Utils.Resource.ReadString(OlCustomUIAttribute.BuildPath(olRibbon.Value, olRibbon.UseAssemblyNamespace, Type.Namespace)));
         }
         else
         {
             var ribbon = NetOffice.Attributes.AttributeExtensions.GetCustomAttribute <CustomUIAttribute>(Type);
             if (null != ribbon && CustomUIAttribute.ContainsProcessedRibbonId(ribbon, ribbon.RibbonID))
             {
                 return(Utils.Resource.ReadString(CustomUIAttribute.BuildPath(ribbon.Value, ribbon.UseAssemblyNamespace, Type.Namespace)));
             }
             else
             {
                 return(string.Empty);
             }
         }
     }
     catch (NetRuntimeSystem.Exception exception)
     {
         Factory.Console.WriteException(exception);
         OnError(ErrorMethodKind.GetCustomUI, exception);
         return(String.Empty);
     }
 }
コード例 #2
0
ファイル: COMAddin.cs プロジェクト: realzhaorong/NetOffice
 public virtual string GetCustomUI(string RibbonID)
 {
     try
     {
         OlCustomUIAttribute olRibbon = GetOlRibbonAttribute(Type, RibbonID);
         if (null != olRibbon)
         {
             return(Utils.Resource.ReadString(OlCustomUIAttribute.BuildPath(olRibbon.Value, olRibbon.UseAssemblyNamespace, Type.Namespace)));
         }
         else
         {
             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 (NetRuntimeSystem.Exception exception)
     {
         NetOffice.DebugConsole.Default.WriteException(exception);
         OnError(ErrorMethodKind.GetCustomUI, exception);
         return(String.Empty);
     }
 }
コード例 #3
0
 public virtual object GetFormRegionManifest([MarshalAs(19)][In] string FormRegionName, [In] int LCID)
 {
     try
     {
         FormRegionAttribute attribute = FormRegionAttribute.GetAttribute(Type, (string)FormRegionName, (int)LCID);
         if (null != attribute)
         {
             return(Utils.Resource.ReadString(CustomUIAttribute.BuildPath(attribute.ManifestFile, true, Type.Namespace)));
         }
         else
         {
             return(null);
         }
     }
     catch (NetRuntimeSystem.Exception exception)
     {
         OnOutlookError(OutlookErrorMethodKind.GetFormRegionManifest, exception);
         return(null);
     }
 }
コード例 #4
0
 public virtual object GetFormRegionStorage(object formRegionName, object item, object lcid, object formRegionMode, object formRegionSize)
 {
     try
     {
         FormRegionAttribute attribute = FormRegionAttribute.GetAttribute(Type, (string)formRegionName, (int)lcid);
         if (null != attribute)
         {
             return(Utils.Resource.ReadBytes(CustomUIAttribute.BuildPath(attribute.StorageFile, true, Type.Namespace)));
         }
         else
         {
             return(null);
         }
     }
     catch (NetRuntimeSystem.Exception exception)
     {
         OnOutlookError(OutlookErrorMethodKind.GetFormRegionStorage, exception);
         return(null);
     }
 }
コード例 #5
0
ファイル: COMAddin.cs プロジェクト: krishkhan/NetOffice-NuGet
 /// <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 (NetRunTimeSystem.Exception exception)
     {
         NetOffice.DebugConsole.WriteException(exception);
         RaiseErrorHandlerMethod(ErrorMethodKind.GetCustomUI, exception);
         return(string.Empty);
     }
 }
コード例 #6
0
 public virtual string GetCustomUI(string RibbonID)
 {
     try
     {
         CustomUIAttribute ribbon = AttributeHelper.GetRibbonAttribute(Type);
         if (null != ribbon)
         {
             return(Utils.Resource.ReadString(CustomUIAttribute.BuildPath(ribbon.Value, ribbon.UseAssemblyNamespace, Type.Namespace)));
         }
         else
         {
             return(String.Empty);
         }
     }
     catch (NetRuntimeSystem.Exception exception)
     {
         Factory.Console.WriteException(exception);
         OnError(ErrorMethodKind.GetCustomUI, exception);
         return(String.Empty);
     }
 }