当前位置: 首页>>代码示例>>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;未经允许,请勿转载。