本文整理汇总了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);
}
}
示例2: Register
public void Register(RegistrationAttribute.RegistrationContext context) {
foreach (var regKey in _keys) {
using (var key = context.CreateKey(regKey.Key)) {
Register(context, key, regKey);
}
}
}
示例3: Register
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public override void Register (RegistrationAttribute.RegistrationContext context)
{
using (RegistrationAttribute.Key regKey = context.CreateKey (CLSIDKey))
{
RegisterWithKey (regKey, regKey.GetType (), context.InprocServerPath, context.CodeBase);
}
}
示例4: Register
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public override void Register (RegistrationAttribute.RegistrationContext context)
{
using (RegistrationAttribute.Key regKey = context.CreateKey (GetParentKey ()))
{
RegisterWithKey (regKey, regKey.GetType ());
}
}
示例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);
}
示例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]");
}
}
示例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());
}
}
示例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));
}
示例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));
}
示例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();
}
}
示例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");
}
}
}
示例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));
}
}
示例13: Register
public override void Register(RegistrationAttribute.RegistrationContext context) {
using (Key serviceKey = context.CreateKey(LanguageServicesKeyName)) {
serviceKey.SetValue("ShowBraceCompletion", (int)1);
}
}
示例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"));
}
}
}
示例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);
}
}
}
}