當前位置: 首頁>>代碼示例>>C#>>正文


C# RegistrationAttribute.CreateKey方法代碼示例

本文整理匯總了C#中Microsoft.VisualStudio.Shell.RegistrationAttribute.CreateKey方法的典型用法代碼示例。如果您正苦於以下問題:C# RegistrationAttribute.CreateKey方法的具體用法?C# RegistrationAttribute.CreateKey怎麽用?C# RegistrationAttribute.CreateKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Microsoft.VisualStudio.Shell.RegistrationAttribute的用法示例。


在下文中一共展示了RegistrationAttribute.CreateKey方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Register

        public override void Register(RegistrationAttribute.RegistrationContext context)
        {
            using (var key = context.CreateKey(string.Format(SupportedTestTypesKey, _hostAdapterName))) {
                key.SetValue(_testTypeGuid, _testTypeName);
            }

            using (var key = context.CreateKey(string.Format(SupportedHostAdaptersKey, _testTypeGuid))) {
                key.SetValue(_hostAdapterName, _hostAdapterDisplayName);
            }
        }
開發者ID:OmerRaviv,項目名稱:VisualStudio-TestHost,代碼行數:10,代碼來源:RegisterSupportedTestTypeAttribute.cs

示例2: Register

 public void Register(RegistrationAttribute.RegistrationContext context) {
     foreach (var regKey in _keys) {
         using (var key = context.CreateKey(regKey.Key)) {
             Register(context, key, regKey);
         }
     }
 }
開發者ID:AlexanderSher,項目名稱:RTVS-Old,代碼行數:7,代碼來源:RegistrationAttributeBuilder.cs

示例3: Register

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public override void Register (RegistrationAttribute.RegistrationContext context)
    {
      using (RegistrationAttribute.Key regKey = context.CreateKey (CLSIDKey))
      {
        RegisterWithKey (regKey, regKey.GetType (), context.InprocServerPath, context.CodeBase);
      }
    }
開發者ID:ashumeow,項目名稱:android-plus-plus,代碼行數:11,代碼來源:ProvideExternObjectAttribute.cs

示例4: Register

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public override void Register (RegistrationAttribute.RegistrationContext context)
    {
      using (RegistrationAttribute.Key regKey = context.CreateKey (GetParentKey ()))
      {
        RegisterWithKey (regKey, regKey.GetType ());
      }
    }
開發者ID:ashumeow,項目名稱:android-plus-plus,代碼行數:11,代碼來源:ProvideDebugBaseAttribute.cs

示例5: Register

        public override void Register(RegistrationAttribute.RegistrationContext context) {
            var engineKey = context.CreateKey("AD7Metrics\\Exception\\" + _engineGuid);
            var key = engineKey;
            foreach (var pathElem in _path) {
                key = key.CreateSubkey(pathElem);
            }

            key.SetValue("Code", _code);
            key.SetValue("State", (int)_state);
        }
開發者ID:whuthj,項目名稱:VisualRust,代碼行數:10,代碼來源:ProvideDebugExceptionAttribute.cs

示例6: Register

 public override void Register(RegistrationAttribute.RegistrationContext context)
 {
     // Create the visibility key.
     using (Key childKey = context.CreateKey(GetPath(context)))
     {
         // Set the value for the command UI guid.
         if (context.GetType().Name.ToUpperInvariant().Contains("PKGDEF"))
             childKey.SetValue(RemapName, new System.Reflection.AssemblyName(context.ComponentType.Assembly.FullName).Version.ToString());
         else
             childKey.SetValue(RemapName, "[ProductVersion]");
     }
 }
開發者ID:pvginkel,項目名稱:VisualGit,代碼行數:12,代碼來源:ProvideUIVersion.cs

示例7: Register

 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").ToUpperInvariant());
         key.SetValue("ResourcePackage", UINamePkg.ToString("B").ToUpperInvariant());
         key.SetValue("ProfileSave", 1);
         //key.SetValue("ResourcePackage", UINamePkg.ToString("B").ToUpperInvariant());
     }
 }
開發者ID:necora,項目名稱:ank_git,代碼行數:13,代碼來源:ProvideLanguageSettings.cs

示例8: Register

        public override void Register(RegistrationAttribute.RegistrationContext context) {
            var engineKey = context.CreateKey("AD7Metrics\\Exception\\" + _engineGuid);

            var key = engineKey.CreateSubkey(_category);
            foreach (var pathElem in _path) {
                key = key.CreateSubkey(pathElem);
            }
            key.SetValue("Code", _code);
            key.SetValue("State", (int)_state);

            string name = _path.LastOrDefault() ?? "*";
            engineKey.SetValue(name, (int)(_state & DkmValidFlags));
        }
開發者ID:bnavarma,項目名稱:ScalaTools,代碼行數:13,代碼來源:ProvideDebugExceptionAttribute.cs

示例9: Register

        /// <summary>
        /// Register this generator
        /// </summary>
        /// <param name="context"></param>
        public override void Register(RegistrationAttribute.RegistrationContext context)
        {
            Guard.NotNull(() => context, context);

            using (RegistrationAttribute.Key generatorsKey = context.CreateKey(@"Generators"))
            {
                using (RegistrationAttribute.Key projectSystemKey = generatorsKey.CreateSubkey(this.ProjectSystem))
                using (RegistrationAttribute.Key generatorKey = projectSystemKey.CreateSubkey(this.Name))
                {
                    generatorKey.SetValue(string.Empty, this.Description);
                    generatorKey.SetValue(@"CLSID", @"{" + this.Type.GUID + @"}");
                    generatorKey.SetValue(@"GeneratesDesignTimeSource", Convert.ToInt32(this.GeneratesDesignTimeSource));
                }

                using (RegistrationAttribute.Key clsIdKey = context.CreateKey(@"CLSID"))
                using (RegistrationAttribute.Key registrationKey = clsIdKey.CreateSubkey(@"{" + this.Type.GUID + @"}"))
                {
                    registrationKey.SetValue(string.Empty, this.Description);
                    registrationKey.SetValue(@"Class", this.Type.FullName);
                    registrationKey.SetValue(@"InprocServer32", context.InprocServerPath);
                    registrationKey.SetValue(@"ThreadingModel", @"Both");
                    if (context.RegistrationMethod == RegistrationMethod.CodeBase)
                    {
                        var fileName = Path.GetFileName(this.Type.Assembly.CodeBase);
                        registrationKey.SetValue(@"CodeBase", Path.Combine(context.ComponentPath, fileName));
                    }
                    else
                    {
                        registrationKey.SetValue(@"Assembly", this.Type.Assembly.FullName);
                    }
                }
            }

            context.Log.WriteLine(string.Format(
                CultureInfo.CurrentCulture,
                Resources.ProvideCodeGeneratorAttribute_RegisterLog,
                this.Name,
                this.Type.GUID));
        }
開發者ID:NuPattern,項目名稱:NuPattern,代碼行數:43,代碼來源:ProvideCodeGeneratorAttribute.cs

示例10: Register

        public override void Register(RegistrationAttribute.RegistrationContext context)
        {
            Key providerKey = null;
            try
            {
                providerKey = context.CreateKey(@"DataProviders\{" + GuidList.guidNpgsqlDdexProviderDataProviderString + @"}");
                providerKey.SetValue(null, ".NET Framework Data Provider for PostgreSQL");
                providerKey.SetValue("AssociatedSource", "{" + GuidList.guidNpgsqlDdexProviderDataSourceString + "}");
                providerKey.SetValue("Description", "Provider_Description, " + this.GetType().Namespace + ".Resources, NpgsqlDdexProvider");
                providerKey.SetValue("DisplayName", "Provider_DisplayName, " + this.GetType().Namespace + ".Resources, NpgsqlDdexProvider");
                providerKey.SetValue("FactoryService", "{" + GuidList.guidNpgsqlDdexProviderObjectFactoryString + "}");
                providerKey.SetValue("InvariantName", "Npgsql");
                providerKey.SetValue("PlatformVersion", "2.0");
                providerKey.SetValue("ShortDisplayName", "Provider_ShortDisplayName, " + this.GetType().Namespace + ".Resources, NpgsqlDdexProvider");
                providerKey.SetValue("Technology", "{77AB9A9D-78B9-4ba7-91AC-873F5338F1D2}");
                
                providerKey = providerKey.CreateSubkey("SupportedObjects");
                providerKey.CreateSubkey(typeof(IVsDataConnectionProperties).Name);
                providerKey.CreateSubkey(typeof(IVsDataConnectionUIProperties).Name);
                providerKey.CreateSubkey(typeof(IVsDataConnectionSupport).Name);
                providerKey.CreateSubkey(typeof(IVsDataObjectSupport).Name);
                providerKey.CreateSubkey(typeof(IVsDataViewSupport).Name);

                providerKey = context.CreateKey(@"DataSources\{" + GuidList.guidNpgsqlDdexProviderDataSourceString + @"}");
                providerKey.SetValue(null, "PostgreSQL Database");
                providerKey.SetValue("DefaultProvider", "{" + GuidList.guidNpgsqlDdexProviderDataProviderString + "}");
                providerKey = providerKey.CreateSubkey("SupportingProviders");
                providerKey = providerKey.CreateSubkey("{" + GuidList.guidNpgsqlDdexProviderDataProviderString + "}");
                providerKey.SetValue("Description", "Provider_Description, " + this.GetType().Namespace + ".Resources, NpgsqlDdexProvider");
                providerKey.SetValue("DisplayName", "Provider_DisplayName, " + this.GetType().Namespace + ".Resources, NpgsqlDdexProvider");
            }
            finally
            {
                if (providerKey != null)
                    providerKey.Close();
            }
        }
開發者ID:CarlosSolrac,項目名稱:npgsql,代碼行數:37,代碼來源:NpgsqlDataProviderRegistration.cs

示例11: Register

        /// <summary>
        /// Called to register this attribute with the given context.  The context
        /// contains the location where the registration information should be placed.
        /// It also contains other information such as the type being registered and path information.
        /// </summary>
        /// <param name="context">Given context to register in</param>
        public override void Register(RegistrationAttribute.RegistrationContext context) {
            if (context == null) {
                throw new ArgumentNullException("context");
            }

            using (Key key = context.CreateKey(String.Format(CultureInfo.InvariantCulture, "{0}\\{1}",
                                                             ToolboxControlsInstallerPath,
                                                             context.ComponentType.Assembly.FullName))) {
                key.SetValue(String.Empty, this.Name);
                key.SetValue("Codebase", context.CodeBase);
                if (this.IsWpfControls) {
                    key.SetValue("WPFControls", "1");
                }
            }

        }
開發者ID:hintofherring,項目名稱:RoboUtes-2014,代碼行數:22,代碼來源:ProvideToolboxControlAttribute.cs

示例12: Register

        public override void Register(RegistrationAttribute.RegistrationContext context) {
            var engineKey = context.CreateKey("AD7Metrics\\Exception\\" + _engineGuid);

            var key = engineKey.CreateSubkey(_category);
            foreach (var pathElem in _path) {
                key = key.CreateSubkey(pathElem);
            }
            key.SetValue("Code", _code);
            key.SetValue("State", (int)_state);

            // Debug engine load time can be improved by writing the exception category default 
            // stop setting and exceptions to the default settings at the exception category reg 
            // key node. This improves debug engine load time by getting necessary exception stop
            // settings for the entire category without having to enumerate the entire category 
            // hive structure when loading the debug engine.
            string name = _path.LastOrDefault();
            if (name == null || !BreakByDefault) {
                engineKey.SetValue(name ?? "*", (int)(_state & DkmValidFlags));
            }
        }
開發者ID:RussBaz,項目名稱:PTVS,代碼行數:20,代碼來源:ProvideDebugExceptionAttribute.cs

示例13: Register

 public override void Register(RegistrationAttribute.RegistrationContext context) {
     using (Key serviceKey = context.CreateKey(LanguageServicesKeyName)) {
         serviceKey.SetValue("ShowBraceCompletion", (int)1);
     }
 }
開發者ID:lioaphy,項目名稱:nodejstools,代碼行數:5,代碼來源:ProvideBraceCompletion.cs

示例14: Register

 /// <summary>Provides registration information about a VSPackage when called by an external registration tool such as regpkg.exe.</summary>
 /// <param name="context">A registration context provided by an external registration tool. The context can be used to create registry keys, log registration activity, and obtain information about the component being registered. </param>
 public override void Register(RegistrationAttribute.RegistrationContext context)
 {
     #if DEBUG
     Console.WriteLine("Registering AsmHighlighter Expression Evaluator");
     #endif
     if (context == null) return;
     using (Key rk = context.CreateKey(string.Format("AD7Metrics\\ExpressionEvaluator\\{0:B}\\{1:B}", LanguageGuid, vendorGuid)))
     {
         rk.SetValue("CLSID", Type.GUID.ToString("B"));
         rk.SetValue("Language", "ASM Language");
         rk.SetValue("Name", "AsmHighlighter");
         using (Key rk2 = rk.CreateSubkey("Engine"))
         {
             rk2.SetValue("0", guidCOMPlusOnlyEng.ToString("B"));
             rk2.SetValue("1", guidCOMPlusNativeEng.ToString("B"));
             rk2.SetValue("2", guidNativeOnlyEng.ToString("B"));
         }
     }
 }
開發者ID:Trass3r,項目名稱:AsmHighlighter,代碼行數:21,代碼來源:RegisterExpressionEvaluatorAttribute.cs

示例15: Register

        //////////////////////////////////////////////////////////////////////
        // ProvideLanguageCodeExpansionAttribute Public Methods.
        /// <include file='doc\ProvideLanguageCodeExpansionAttribute.uex' path='docs/doc[@for="ProvideLanguageCodeExpansionAttribute.Register"]' />
        public override void Register(RegistrationAttribute.RegistrationContext context)
        {
            context.Log.WriteLine(string.Format(Resources.Culture, Resources.Reg_NotifyLanguageCodeExpansion, LanguageServiceSid.ToString("B")));

            string packageGuid = context.ComponentType.GUID.ToString("B");
            // Create our top-most language key
            using (Key serviceKey = context.CreateKey(LanguageRegistryKey))
            {
                // Add specific entries corresponding to arguments to
                // ProvideLanguageCodeExpansionAttribute constructor.
                serviceKey.SetValue(string.Empty, LanguageServiceSid.ToString("B"));
                serviceKey.SetValue(RegistryPaths.package, packageGuid);
                serviceKey.SetValue(RegistryPaths.displayName, displayName);
                serviceKey.SetValue(RegistryPaths.languageStringId, languageIdString);
                serviceKey.SetValue(RegistryPaths.indexPath, snippetIndexPath);
                serviceKey.SetValue(RegistryPaths.showRoots, showRoots ? 1 : 0);
                if (!string.IsNullOrEmpty(SearchPaths))
                {
                    using (Key pathsKey = serviceKey.CreateSubkey(RegistryPaths.paths))
                    {
                        pathsKey.SetValue(LanguageName, SearchPaths);
                    }
                }
                if (!string.IsNullOrEmpty(ForceCreateDirs))
                {
                    using (Key forceCreateKey = serviceKey.CreateSubkey(RegistryPaths.forceCreateDirs))
                    {
                        forceCreateKey.SetValue(LanguageName, ForceCreateDirs);
                    }
                }
            }
        }
開發者ID:Graham-Pedersen,項目名稱:IronPlot,代碼行數:35,代碼來源:ProvideLanguageCodeExpansionAttribute.cs


注:本文中的Microsoft.VisualStudio.Shell.RegistrationAttribute.CreateKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。