public static void UnregisterFunction(Type type) { if (null == type) { throw new ArgumentNullException("type"); } if (null != type.GetCustomAttribute <DontRegisterAddinAttribute>()) { return; } COMAddinUnRegisterHandler.Proceed(type, new string[] { _addinOfficeRegistryKey }, InstallScope.System, OfficeUnRegisterKeyState.NeedToDelete); }
private static void OptimizedUnregisterFunction(Type type, int scope, int keyState) { if (null == type) { throw new ArgumentNullException("type"); } if (null != type.GetCustomAttribute <DontRegisterAddinAttribute>()) { return; } InstallScope currentScope = (InstallScope)scope; OfficeUnRegisterKeyState currentKeyState = (OfficeUnRegisterKeyState)keyState; COMAddinUnRegisterHandler.Proceed(type, new string[] { _addinOfficeRegistryKey }, currentScope, currentKeyState); }
private static void OptimizedUnregisterFunction(Type type, int scope, int keyState) { if (null == type) { throw new ArgumentNullException("type"); } InstallScope currentScope = (InstallScope)scope; OfficeUnRegisterKeyState currentKeyState = (OfficeUnRegisterKeyState)keyState; MultiRegisterAttribute attribute = MultiRegisterAttribute.GetAttribute(type); string[] product = new string[attribute.Products.Length]; for (int i = 0; i < attribute.Products.Length; i++) { product[i] = String.Format(_addinOfficeRegistryKey, MultiRegisterAttribute.RegistryEntry(attribute.Products[i])); } COMAddinUnRegisterHandler.Proceed(type, product, currentScope, currentKeyState); }
public static void UnregisterFunction(Type type) { try { MultiRegisterAttribute attribute = MultiRegisterAttribute.GetAttribute(type); string[] product = new string[attribute.Products.Length]; for (int i = 0; i < attribute.Products.Length; i++) { product[i] = String.Format(_addinOfficeRegistryKey, MultiRegisterAttribute.RegistryEntry(attribute.Products[i])); } COMAddinUnRegisterHandler.Proceed(type, product, InstallScope.System, OfficeUnRegisterKeyState.NeedToDelete); } catch (Exception exception) { if (!RegisterErrorHandler.RaiseStaticErrorHandlerMethod(type, RegisterErrorMethodKind.UnRegister, new NetOfficeException(exception.Message, exception))) { throw; } } }