示例#1
0
        public static void RegisterFunction(Type type)
        {
            if (null == type)
            {
                throw new ArgumentNullException("type");
            }
            if (null != type.GetCustomAttribute <DontRegisterAddinAttribute>())
            {
                return;
            }

            COMAddinRegisterHandler.Proceed(type, new string[] { _addinOfficeRegistryKey }, InstallScope.System, OfficeRegisterKeyState.NeedToCreate);
        }
示例#2
0
        private static void OptimizedRegisterFunction(Type type, int scope, int keyState)
        {
            if (null == type)
            {
                throw new ArgumentNullException("type");
            }
            if (null != type.GetCustomAttribute <DontRegisterAddinAttribute>())
            {
                return;
            }

            OfficeRegisterKeyState currentKeyState = (OfficeRegisterKeyState)keyState;

            COMAddinRegisterHandler.ProceedUser(type, new string[] { _addinOfficeRegistryKey, _addinOfficeRegistryKey64 }, currentKeyState);
        }
示例#3
0
        private static void OptimizedRegisterFunction(Type type, int scope, int keyState)
        {
            if (null == type)
            {
                throw new ArgumentNullException("type");
            }
            if (null != type.GetCustomAttribute <DontRegisterAddinAttribute>())
            {
                return;
            }

            InstallScope           currentScope    = (InstallScope)scope;
            OfficeRegisterKeyState currentKeyState = (OfficeRegisterKeyState)keyState;

            COMAddinRegisterHandler.Proceed(type, new string[] { _addinOfficeRegistryKey }, currentScope, currentKeyState);
            RegisterHandleRequireShutdownNotificationAttribute(type);
            RegisterHandleFormRegionAttribute(type);
        }
示例#4
0
        private static void OptimizedRegisterFunction(Type type, int scope, int keyState)
        {
            if (null == type)
            {
                throw new ArgumentNullException("type");
            }
            InstallScope           currentScope    = (InstallScope)scope;
            OfficeRegisterKeyState currentKeyState = (OfficeRegisterKeyState)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]));
            }

            COMAddinRegisterHandler.Proceed(type, product, currentScope, currentKeyState);
        }
示例#5
0
        public static void RegisterFunction(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]));
                }

                COMAddinRegisterHandler.Proceed(type, product, InstallScope.System, OfficeRegisterKeyState.NeedToCreate);
            }
            catch (Exception exception)
            {
                if (!RegisterErrorHandler.RaiseStaticErrorHandlerMethod(type, RegisterErrorMethodKind.Register, new NetOfficeException(exception.Message, exception)))
                {
                    throw;
                }
            }
        }