/// <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)
        {
            // Write to the context's log what we are about to do
            context.Log.WriteLine(String.Format(CultureInfo.CurrentCulture, "SccProvider:\t\t{0}\n", RegName));

            // Declare the source control provider, its name, the provider's service
            // and aditionally the packages implementing this provider
            using (Key sccProviders = context.CreateKey("SourceControlProviders"))
            {
                using (Key sccProviderKey = sccProviders.CreateSubkey(RegGuid.ToString("B")))
                {
                    sccProviderKey.SetValue("", RegName);
                    sccProviderKey.SetValue("Service", SccProviderService.ToString("B"));

                    using (Key sccProviderNameKey = sccProviderKey.CreateSubkey("Name"))
                    {
                        sccProviderNameKey.SetValue("", UIName);
                        sccProviderNameKey.SetValue("Package", UINamePkg.ToString("B"));

                        sccProviderNameKey.Close();
                    }

                    // Additionally, you can create a "Packages" subkey where you can enumerate the dll
                    // that are used by the source control provider, something like "Package1"="SccProvider.dll"
                    // but this is not a requirement.
                    sccProviderKey.Close();
                }

                sccProviders.Close();
            }
        }
Exemplo n.º 2
0
        public override void Register(RegistrationAttribute.RegistrationContext context)
        {
            // Write to the context's log what we are about to do
            context.Log.WriteLine(String.Format(CultureInfo.CurrentCulture,
                                                "Issue Repository Connector:\t\t{0}\n", RegName));

            // Declare the issue repository connector, its name, the provider's service
            using (Key connectors = context.CreateKey(REG_KEY_CONNECTORS))
            {
                using (Key connectorKey = connectors.CreateSubkey(RegGuid.ToString("B").ToUpperInvariant()))
                {
                    connectorKey.SetValue("", RegName);
                    connectorKey.SetValue(REG_VALUE_SERVICE, IssueRepositoryConnectorService.ToString("B").ToUpperInvariant());

                    using (Key connectorNameKey = connectorKey.CreateSubkey(REG_KEY_NAME))
                    {
                        connectorNameKey.SetValue("", UIName);
                        connectorNameKey.SetValue(REG_VALUE_PACKAGE, UINamePkg.ToString("B").ToUpperInvariant());

                        connectorNameKey.Close();
                    }
                    connectorKey.Close();
                }
                connectors.Close();
            }
        }
Exemplo n.º 3
0
 public override void Register(RegistrationAttribute.RegistrationContext context)
 {
     using (Key key = context.CreateKey(GetKey(_key)))
     {
         key.SetValue("", _exportName);
         key.SetValue("Description", string.Format("#{0}", _desc));
         key.SetValue("Name", _name);
         key.SetValue("Package", UINamePkg.ToString("B"));
         key.SetValue("ResourcePackage", UINamePkg.ToString("B"));
         key.SetValue("ProfileSave", 1);
     }
 }