Beispiel #1
0
 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);
     }
 }
Beispiel #2
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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #5
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);
     }
 }