예제 #1
0
        /// <summary>
        ///     Called to register this attribute with the given context.  The context
        ///     contains the location where the registration inforomation should be placed.
        ///     It also contains other information such as the type being registered and path information.
        /// </summary>
        public override void Register(RegistrationContext context)
        {
            using (Key childKey = context.CreateKey(GeneratorRegKey))
            {
                childKey.SetValue(string.Empty, GeneratorName);
                childKey.SetValue("CLSID", GeneratorGuid.ToString("B"));

                if (GeneratesDesignTimeSource)
                {
                    childKey.SetValue("GeneratesDesignTimeSource", 1);
                }

                if (GeneratesSharedDesignTimeSource)
                {
                    childKey.SetValue("GeneratesSharedDesignTimeSource", 1);
                }
            }

            if (FileExtension != null)
            {
                using (Key childKey = context.CreateKey(FileExtensionGeneratorRegKey))
                {
                    childKey.SetValue(string.Empty, GeneratorRegKeyName);
                }
            }
        }
        /// <summary>
        ///     Called to register this attribute with the given context.  The context
        ///     contains the location where the registration inforomation should be placed.
        ///     It also contains other information such as the type being registered and path information.
        /// </summary>
        public override void Register(RegistrationContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            using (Key childKey = context.CreateKey(GeneratorRegKey))
            {
                childKey.SetValue(string.Empty, GeneratorName);
                childKey.SetValue("CLSID", GeneratorGuid.ToString("B"));

                if (GeneratesDesignTimeSource)
                {
                    childKey.SetValue("GeneratesDesignTimeSource", 1);
                }

                if (GeneratesSharedDesignTimeSource)
                {
                    childKey.SetValue("GeneratesSharedDesignTimeSource", 1);
                }
            }
        }