private static void UnregisterHandleDocumentInspector(Type type)
 {
     try
     {
         DocumentInspectorAttribute[] attributes = DocumentInspectorAttribute.GetAttributes(type);
         if (attributes.Length > 0)
         {
             RegistryLocationAttribute location = AttributeReflector.GetRegistryLocationAttribute(type);
             GuidAttribute             typeid   = AttributeReflector.GetGuidAttribute(type);
             foreach (var attribute in attributes)
             {
                 foreach (var version in attribute.ProcessedApplicationVersion)
                 {
                     DocumentInspectorAttribute.TryDeleteKey("Word", attribute.Name, version);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         NetOffice.DebugConsole.Default.WriteException(exception);
         if (!RegisterErrorHandler.RaiseStaticErrorHandlerMethod(type, RegisterErrorMethodKind.UnRegister, exception))
         {
             throw;
         }
     }
 }
Example #2
0
 private static void RegisterHandleDocumentInspector(Type type)
 {
     try
     {
         DocumentInspectorAttribute[] attributes = DocumentInspectorAttribute.GetAttributes(type);
         if (attributes.Length > 0)
         {
             GuidAttribute typeid = AttributeReflector.GetGuidAttribute(type);
             foreach (var attribute in attributes)
             {
                 foreach (var version in attribute.ProcessedApplicationVersion)
                 {
                     DocumentInspectorAttribute.CreateKey("Word", attribute.Name, version, attribute.Selected, typeid.Value);
                 }
             }
         }
     }
     catch (NetRuntimeSystem.Exception exception)
     {
         NetOffice.DebugConsole.Default.WriteException(exception);
         if (!RegisterErrorHandler.RaiseStaticErrorHandlerMethod(type, RegisterErrorMethodKind.Register, exception))
         {
             throw;
         }
     }
 }