当前位置: 首页>>代码示例>>C#>>正文


C# RegistrationContext.CreateKey方法代码示例

本文整理汇总了C#中RegistrationContext.CreateKey方法的典型用法代码示例。如果您正苦于以下问题:C# RegistrationContext.CreateKey方法的具体用法?C# RegistrationContext.CreateKey怎么用?C# RegistrationContext.CreateKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RegistrationContext的用法示例。


在下文中一共展示了RegistrationContext.CreateKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Register

        public override void Register(RegistrationContext context)
        {
            using (Key shellRegistrationKey = context.CreateKey(
                string.Format(@"Generators\{0}\{1}",
                    vsContextGuids.vsContextGuidVCSProject,
                    CustomToolType.Name)))
            {
                shellRegistrationKey.SetValue(string.Empty, Name);
                shellRegistrationKey.SetValue("CLSID", CustomToolType.GUID.ToString("B"));
                shellRegistrationKey.SetValue("GeneratesDesignTimeSource", 1);
                shellRegistrationKey.SetValue("GeneratesSharedDesignTimeSource", 1);
            }

            if (!string.IsNullOrEmpty(FileExtension))
            {
                using (Key shellRegistryFileKey = context.CreateKey(
                string.Format(@"Generators\{0}\{1}",
                    vsContextGuids.vsContextGuidVCSProject,
                    FileExtension)))
                {
                    if (FileExtension.StartsWith("."))
                    {
                        shellRegistryFileKey.SetValue(string.Empty,
                            CustomToolType.Name);
                    }
                    else
                    {
                        shellRegistryFileKey.SetValue(string.Empty,
                            "." + CustomToolType.Name);
                    }
                }
            }
        }
开发者ID:XewTurquish,项目名称:vsminecraft,代码行数:33,代码来源:CustomToolRegistrationAttribute.cs

示例2: Register

 public override void Register(RegistrationContext context)
 {
     using (var guid = context.CreateKey(@"AD7Metrics\Engine\" + new Guid(Constants.DebuggerGuid).ToString("B"))) {
         guid.SetValue("", Constants.DebuggerIdString);
         guid.SetValue("CLSID", typeof(AD7Engine).GUID.ToString("B"));
         guid.SetValue("ProgramProvider", typeof(AD7ProgramProvider).GUID.ToString("B"));
         guid.SetValue("Attach", 1);
         guid.SetValue("AddressBP", 0);
         guid.SetValue("AutoSelectPriority", 4);
         //engineKey.SetValue("Exceptions", 1);
         //engineKey.SetValue("RemoteDebugging", 1);
         guid.SetValue("CallstackBP", 1);
         guid.SetValue("Name", Constants.EngineName);
         guid.SetValue("PortSupplier", "{708C1ECA-FF48-11D2-904F-00C04FA302A1}");
         guid.SetValue("AlwaysLoadProgramProviderLocal", 1);
         using (var incompat = guid.CreateSubkey("IncompatibleList")) {
             incompat.SetValue("guidCOMPlusNativeEng", "{92EF0900-2251-11D2-B72E-0000F87572EF}");
             incompat.SetValue("guidCOMPlusOnlyEng", "{449EC4CC-30D2-4032-9256-EE18EB41B62B}");
             incompat.SetValue("guidNativeOnlyEng", "{449EC4CC-30D2-4032-9256-EE18EB41B62B}");
             incompat.SetValue("guidScriptEng", "{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}");
         }
     }
     foreach (var t in typesToRegister) {
         using (var tkey = context.CreateKey(@"CLSID\" + t.GUID.ToString("B"))) {
             tkey.SetValue("Assembly", t.Assembly.FullName);
             tkey.SetValue("Class", t.FullName);
             tkey.SetValue("InprocServer32", context.InprocServerPath);
             //System.IO.Path.Combine(System.Environment.SystemDirectory, "mscoree.dll"));
             //tkey.SetValue("CodeBase", t.Assembly.Location);
             tkey.SetValue("CodeBase", Path.Combine(context.ComponentPath, t.Module.Name));
         }
     }
 }
开发者ID:bagobor,项目名称:NodeVsDebugger,代码行数:33,代码来源:NodeVsDebuggerRegistrationAttribute.cs

示例3: Register

        public override void Register(RegistrationContext context)
        {
            var engineKey = context.CreateKey("AD7Metrics\\Engine\\" + id);
            engineKey.SetValue("Name", name);
            engineKey.SetValue("CLSID", engine.GUID.ToString("B"));
            engineKey.SetValue("ProgramProvider", provider.GUID.ToString("B"));
            engineKey.SetValue("PortSupplier", "{708C1ECA-FF48-11D2-904F-00C04FA302A1}");

            engineKey.SetValue("Attach", 1);
            engineKey.SetValue("AlwaysLoadLocal", 1);
            engineKey.SetValue("AlwaysLoadProgramProviderLocal", 1);
            engineKey.SetValue("Disassembly", 1);
            engineKey.SetValue("EnginePriority", 0x51);
            engineKey.SetValue("SetNextStatement", 1);
            
            var debuggerRegKey = context.CreateKey("CLSID\\" + engine.GUID.ToString("B"));
            debuggerRegKey.SetValue("Assembly", engine.Assembly.GetName().Name);
            debuggerRegKey.SetValue("Class", engine.FullName);
            debuggerRegKey.SetValue("InprocServer32", context.InprocServerPath);
            debuggerRegKey.SetValue("CodeBase", Path.Combine(context.ComponentPath, engine.Module.Name));

            var provRegKey = context.CreateKey("CLSID\\" + provider.GUID.ToString("B"));
            provRegKey.SetValue("Assembly", provider.Assembly.GetName().Name);
            provRegKey.SetValue("Class", provider.FullName);
            provRegKey.SetValue("InprocServer32", context.InprocServerPath);
            provRegKey.SetValue("CodeBase", Path.Combine(context.ComponentPath, provider.Module.Name));
        }
开发者ID:Boddlnagg,项目名称:VisualRust,代码行数:27,代码来源:ProvideDebugEngineAttribute.cs

示例4: Register

        public override void Register(RegistrationContext context) {
            using (Key key = context.CreateKey(@"Languages\Language Services\" + _language)) {
                key.SetValue("ShowBraceCompletion", 1);
            }

            using (Key key = context.CreateKey(@"Text Editor\" + _language)) {
                key.SetValue("Brace Completion", 1);
            }
        }
开发者ID:AlexanderSher,项目名称:RTVS-Old,代码行数:9,代码来源:ShowBraceCompletionAttribute.cs

示例5: Register

        public override void Register(RegistrationContext context) {
            var langSvcKey = context.CreateKey("Languages\\Language Services\\" + _languageName + "\\Debugger Languages\\" + _languageGuid);
            langSvcKey.SetValue("", _languageName);
            // 994... is the vendor ID (Microsoft)
            var eeKey = context.CreateKey("AD7Metrics\\ExpressionEvaluator\\" + _languageGuid + "\\{994B45C4-E6E9-11D2-903F-00C04FA302A1}");
            eeKey.SetValue("Language", _languageName);
            eeKey.SetValue("Name", _languageName);
            eeKey.SetValue("CLSID", _eeGuid);

            var engineKey = eeKey.CreateSubkey("Engine");
            engineKey.SetValue("0", _engineGuid);
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:12,代码来源:ProvideDebugLanguageAttribute.cs

示例6: Register

        public override void Register(RegistrationContext context) {
            var engineKey = context.CreateKey("AD7Metrics\\PortSupplier\\" + _id);
            engineKey.SetValue("Name", _name);
            engineKey.SetValue("CLSID", _portSupplier.GUID.ToString("B"));

            var clsidKey = context.CreateKey("CLSID");
            var clsidGuidKey = clsidKey.CreateSubkey(_portSupplier.GUID.ToString("B"));
            clsidGuidKey.SetValue("Assembly", _portSupplier.Assembly.FullName);
            clsidGuidKey.SetValue("Class", _portSupplier.FullName);
            clsidGuidKey.SetValue("InprocServer32", context.InprocServerPath);
            clsidGuidKey.SetValue("CodeBase", Path.Combine(context.ComponentPath, _portSupplier.Module.Name));
            clsidGuidKey.SetValue("ThreadingModel", "Free");
        }
开发者ID:whuthj,项目名称:VisualRust,代码行数:13,代码来源:ProvideDebugPortSupplierAttribute.cs

示例7: Register

        /// <include file='doc\ProvideObjectAttribute.uex' path='docs/doc[@for="Register"]' />
        /// <devdoc>
        ///     Called to register this attribute with the given context.  The context
        ///     contains the location where the registration inforomation should be placed.
        ///     it also contains such as the type being registered, and path information.
        ///
        ///     This method is called both for registration and unregistration.  The difference is
        ///     that unregistering just uses a hive that reverses the changes applied to it.
        /// </devdoc>
        public override void Register(RegistrationContext context) {
            context.Log.WriteLine(SR.GetString(SR.Reg_NotifyCreateObject, ObjectType.Name));

            using (Key childKey = context.CreateKey(CLSIDRegKey))
            {
                childKey.SetValue(string.Empty, ObjectType.FullName);
                childKey.SetValue("InprocServer32", context.InprocServerPath);
                childKey.SetValue("Class", ObjectType.FullName);

                // If specified on the command line, let the command line option override
                if (context.RegistrationMethod != RegistrationMethod.Default) {
                    registrationMethod = context.RegistrationMethod;
                }

            switch(registrationMethod) {
                case RegistrationMethod.Default:
                case RegistrationMethod.Assembly:
                    childKey.SetValue("Assembly", ObjectType.Assembly.FullName);
                    break;
                
                    case RegistrationMethod.CodeBase:
                        childKey.SetValue("CodeBase", context.CodeBase);
                        break;
                }

                childKey.SetValue("ThreadingModel", "Both");
            }
        }
开发者ID:hesam,项目名称:SketchSharp,代码行数:37,代码来源:ProvideObjectAttribute.cs

示例8: Register

 public override void Register(RegistrationContext context)
 {
     using (Key key = context.CreateKey(EditorRegKey))
     {
         key.SetValue("LinkedEditorGuid", LinkedFactoryType.GUID.ToString("B"));
     }
 }
开发者ID:chandramouleswaran,项目名称:LangSvcV2,代码行数:7,代码来源:ProvideLinkedEditorFactoryAttribute.cs

示例9: Register

        /// <include file='doc\ProvideToolboxItemsAttribute.uex' path='docs/doc[@for="Register"]' />
        /// <devdoc>
        ///     Called to register this attribute with the given context.  The context
        ///     contains the location where the registration inforomation should be placed.
        ///     it also contains such as the type being registered, and path information.
        /// </devdoc>
        public override void Register(RegistrationContext context) {

            using (Key packageKey = context.CreateKey(GetPackageRegKey(context.ComponentType.GUID)))
            {
                using (Key childKey = packageKey.CreateSubkey("Toolbox"))
                {
                    childKey.SetValue("Default Items", Version);

                    if (_needsCallbackAfterReset)
                        childKey.SetValue("NeedsCallbackAfterReset", 1);

                    // Search the package for the AllowToolboxFormat attribute.
                    //
                    string format = string.Empty;
                    foreach(ProvideToolboxFormatAttribute pfa in context.ComponentType.GetCustomAttributes(typeof(ProvideToolboxFormatAttribute), true)) {
                        if (format.Length == 0) {
                            format = pfa.Format;
                        }
                        else {
                            format = string.Format(CultureInfo.InvariantCulture, "{0}, {1}", format, pfa.Format);
                        }
                    }

                    if (format.Length > 0) {
                        childKey.SetValue("Formats", format);
                    }

                    if (_needsCallbackAfterReset) {
                        childKey.SetValue("NeedsCallbackAfterReset", (int)1);
                    }

                    context.Log.WriteLine(SR.GetString(SR.Reg_NotifyToolboxItem, Version, format));
                }
            }
        }
开发者ID:hesam,项目名称:SketchSharp,代码行数:41,代码来源:ProvideToolboxItemsAttribute.cs

示例10: Register

 public override void Register(RegistrationContext context)
 {
     using (var key = context.CreateKey(GetKeyName()))
     {
         key.SetValue("", PackageGuid.ToString("B"));
     }
 }
开发者ID:HexWrench,项目名称:VisualHG2015,代码行数:7,代码来源:ProvideSolutionPersistenceAttribute.cs

示例11: Register

 public override void Register(RegistrationContext context)
 {
     using (Key languageTemplatesKey = context.CreateKey(LanguageTemplatesKey))
     {
         languageTemplatesKey.SetValue(FlavoredFactoryGuid, LanguageTemplateFactoryType.GUID.ToString("B"));
     }
 }
开发者ID:CaptainHayashi,项目名称:visualfsharp,代码行数:7,代码来源:WAProvideProjectFactoryTemplateMappingAttribute.cs

示例12: Register

 public override void Register(RegistrationContext context)
 {
     if (context == null) throw new ArgumentException("Bad context to register Boo MsBuild task.");
     Key key = context.CreateKey(_safeImportPath);
     key.SetValue(_regLabel, _targetPath);
     key.Close();
 }
开发者ID:jagregory,项目名称:boolangstudio,代码行数:7,代码来源:RegisterMsBuildTargetsAttribute.cs

示例13: Register

 /// <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, string.Empty);
     }
 }
开发者ID:DelBero,项目名称:XnaScrapEdit,代码行数:12,代码来源:SingleFileGeneratorSupportRegistrationAttribute.cs

示例14: Register

        // <include file='doc\ProvideLoadKeyAttribute.uex' path='docs/doc[@for="Register"]' />
        // <devdoc>
        // Called to register this attribute with the given context.  The context
        // contains the location where the registration inforomation should be placed.
        // it also contains such as the type being registered, and path information.
        //
        // This method is called both for registration and unregistration.  The difference is
        // that unregistering just uses a hive that reverses the changes applied to it.
        // </devdoc>
        public override void Register(RegistrationContext context)
        {
            using (Key packageKey = context.CreateKey(RegKeyName(context)))
            {
                if (WDExpressId != 0)
                {
                    packageKey.SetValue("WDExpressId", WDExpressId);
                }

                if (VWDExpressId != 0)
                {
                    packageKey.SetValue("VWDExpressId", VWDExpressId);
                }

                if (VsWinExpressId != 0)
                {
                    packageKey.SetValue("VsWinExpressId", VsWinExpressId);
                }

                packageKey.SetValue("MinEdition", MinimumEdition);
                packageKey.SetValue("ProductVersion", ProductVersion);
                packageKey.SetValue("ProductName", ProductName);
                packageKey.SetValue("CompanyName", CompanyName);
            }
        }
开发者ID:riversky,项目名称:roslyn,代码行数:34,代码来源:PackageLoadKeyAttribute.cs

示例15: Register

 public override void Register(RegistrationContext context) {
     using (var engineKey = context.CreateKey("Projects\\" + _id + "\\Filters\\" + _name)) {
         engineKey.SetValue("", _filter);
         engineKey.SetValue("SortPriority", _sortPriority);
         engineKey.SetValue("CommonOpenFilesFilter", 1);
     }
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:7,代码来源:ProvideFileFilterAttribute.cs


注:本文中的RegistrationContext.CreateKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。