本文整理汇总了C#中Microsoft.VisualStudio.Shell.RegistrationAttribute类的典型用法代码示例。如果您正苦于以下问题:C# RegistrationAttribute类的具体用法?C# RegistrationAttribute怎么用?C# RegistrationAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistrationAttribute类属于Microsoft.VisualStudio.Shell命名空间,在下文中一共展示了RegistrationAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Register
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public override void Register (RegistrationAttribute.RegistrationContext context)
{
using (RegistrationAttribute.Key regKey = context.CreateKey (GetParentKey ()))
{
RegisterWithKey (regKey, regKey.GetType ());
}
}
示例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: Unregister
public override void Unregister(RegistrationAttribute.RegistrationContext context)
{
context.RemoveValue(string.Format(SupportedTestTypesKey, _hostAdapterName), _testTypeGuid);
context.RemoveKeyIfEmpty(string.Format(SupportedTestTypesKey, _hostAdapterName));
context.RemoveValue(string.Format(SupportedHostAdaptersKey, _testTypeGuid), _hostAdapterName);
context.RemoveKeyIfEmpty(string.Format(SupportedHostAdaptersKey, _testTypeGuid));
}
示例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)
{
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);
}
}
示例7: 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]");
}
}
示例8: 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());
}
}
示例9: 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));
}
示例10: Register
public override void Register(RegistrationAttribute.RegistrationContext context)
{
Key packageKey = null, packageProviderRef = null, packageProvider = null;
try
{
packageKey = context.CreateKey(@"DataSources\{" + dataSourceGuid + @"}");
packageKey.SetValue("", dataSourceName);
packageKey.SetValue("DefaultProvider", @"{" + dataProviderGuid + @"}");
packageProviderRef = packageKey.CreateSubkey(@"SupportingProviders\{"+ dataProviderGuid + @"}");
packageProviderRef.SetValue("DisplayName", "Provider_Label, VSPackage, NuoDb.VisualStudio.DataTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b856dd8cd87216c3");
packageProviderRef.SetValue("Description", "Provider_Help, VSPackage, NuoDb.VisualStudio.DataTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b856dd8cd87216c3");
packageProvider = context.CreateKey(@"DataProviders\{" + dataProviderGuid + @"}");
packageProvider.SetValue("", dataProviderName);
packageProvider.SetValue("Description", "Provider_Description, VSPackage, NuoDb.VisualStudio.DataTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b856dd8cd87216c3");
packageProvider.SetValue("DisplayName", "Provider_DisplayName, VSPackage, NuoDb.VisualStudio.DataTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b856dd8cd87216c3");
packageProvider.SetValue("ShortDisplayName", "Provider_ShortDisplayName, VSPackage, NuoDb.VisualStudio.DataTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b856dd8cd87216c3");
//packageProvider.SetValue("CodeBase", context.CodeBase);
packageProvider.SetValue("InvariantName", "NuoDb.Data.Client");
//packageProvider.SetValue("RuntimeInvariantName", "System.Data.SqlServerCe.3.5");
packageProvider.SetValue("Technology", "{77AB9A9D-78B9-4ba7-91AC-873F5338F1D2}");
packageProvider.SetValue("FactoryService", "{" + factoryGuid + "}");
//packageProvider.SetValue("AssociatedSource", "{" + dataSourceGuid + "}");
//packageProvider.SetValue("PlatformVersion", "1.0");
packageProvider.CreateSubkey(@"SupportedObjects\DataConnectionProperties").SetValue("", "NuoDb.VisualStudio.DataTools.NuoDbDataConnectionProperties");
packageProvider.CreateSubkey(@"SupportedObjects\DataConnectionSupport").SetValue("", "NuoDb.VisualStudio.DataTools.NuoDbDataConnectionSupport");
packageProvider.CreateSubkey(@"SupportedObjects\DataConnectionUIControl").SetValue("", "NuoDb.VisualStudio.DataTools.NuoDbDataConnectionUIControl");
packageProvider.CreateSubkey(@"SupportedObjects\DataViewSupport").SetValue("", "NuoDb.VisualStudio.DataTools.NuoDbDataViewSupport");
packageProvider.CreateSubkey(@"SupportedObjects\DataObjectSupport").SetValue("", "NuoDb.VisualStudio.DataTools.NuoDbDataObjectSupport");
packageProvider.CreateSubkey(@"SupportedObjects\DataConnectionPromptDialog");
packageProvider.CreateSubkey(@"SupportedObjects\DataSourceSpecializer");
packageProvider.CreateSubkey(@"SupportedObjects\Microsoft.VisualStudio.Data.Services.SupportEntities.IVsDataConnectionUIConnector");
packageProvider.CreateSubkey(@"SupportedObjects\Microsoft.VisualStudio.Data.Core.IVsDataProviderDynamicSupport");
}
finally
{
if (packageKey != null)
packageKey.Close();
if (packageProviderRef != null)
packageProviderRef.Close();
if (packageProvider != null)
packageProvider.Close();
}
}
示例11: Unregister
private void Unregister(RegistrationAttribute.RegistrationContext context, string prefix, RegKey regKey) {
prefix += "\\" + regKey.Key;
foreach (var registrySubKey in regKey.SubKeys) {
Unregister(context, prefix, registrySubKey);
}
foreach (var value in regKey.Values) {
context.RemoveValue(prefix, value.Key);
}
if (regKey.Package != null) {
context.RemoveValue(prefix, regKey.Package);
}
}
示例12: 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");
}
}
}
示例13: 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));
}
}
示例14: 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));
}
示例15: 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();
}
}