本文整理匯總了C#中Microsoft.VisualStudio.Shell.RegistrationAttribute.RemoveKeyIfEmpty方法的典型用法代碼示例。如果您正苦於以下問題:C# RegistrationAttribute.RemoveKeyIfEmpty方法的具體用法?C# RegistrationAttribute.RemoveKeyIfEmpty怎麽用?C# RegistrationAttribute.RemoveKeyIfEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.VisualStudio.Shell.RegistrationAttribute
的用法示例。
在下文中一共展示了RegistrationAttribute.RemoveKeyIfEmpty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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));
}
示例2: Unregister
/// <summary>Removes 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 remove registry keys, log registration activity, and obtain information about the component being registered. </param>
public override void Unregister(RegistrationAttribute.RegistrationContext context)
{
if (context == null) return;
#if DEBUG
Console.WriteLine("Unregistering AsmHighlighter Expression Evaluator");
#endif
context.RemoveKey(string.Format("AD7Metrics\\ExpressionEvaluator\\{0:B}\\{1:B}", languageGuid, vendorGuid));
context.RemoveKeyIfEmpty(string.Format("AD7Metrics\\ExpressionEvaluator\\{0:B}", languageGuid));
}