本文整理汇总了C#中RegistrationContext类的典型用法代码示例。如果您正苦于以下问题:C# RegistrationContext类的具体用法?C# RegistrationContext怎么用?C# RegistrationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistrationContext类属于命名空间,在下文中一共展示了RegistrationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
}
}
示例2: 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));
}
}
}
示例3: Unregister
public override void Unregister(RegistrationContext context)
{
context.RemoveKey(@"AD7Metrics\Engine\" + new Guid(Constants.DebuggerGuid).ToString("B"));
foreach (var t in typesToRegister) {
context.RemoveKey(@"CLSID\" + t.GUID.ToString("B"));
}
}
示例4: Unregister
public override void Unregister(RegistrationContext context)
{
if (context != null)
{
context.RemoveKey(LanguageName());
}
}
示例5: 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
示例6: 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();
}
示例7: Register
/// <summary>
/// Called to register this attribute with the given context.
/// </summary>
/// <param name="context">
/// Contains the location where the registration information should be placed.
/// It also contains other informations as the type being registered and path information.
/// </param>
public override void Register(RegistrationContext context) {
if (context == null) {
return;
}
using (Key childKey = context.CreateKey(LanguageName())) {
childKey.SetValue("", LanguageGuid);
string snippetIndexPath = context.ComponentPath;
snippetIndexPath = Path.Combine(snippetIndexPath, IndexPath);
snippetIndexPath = context.EscapePath(System.IO.Path.GetFullPath(snippetIndexPath));
childKey.SetValue("DisplayName", DisplayName.ToString(CultureInfo.InvariantCulture));
childKey.SetValue("IndexPath", snippetIndexPath);
childKey.SetValue("LangStringId", LanguageStringId.ToLowerInvariant());
childKey.SetValue("Package", context.ComponentType.GUID.ToString("B"));
childKey.SetValue("ShowRoots", ShowRoots ? 1 : 0);
//The following enables VS to look into a user directory for more user-created snippets
string myDocumentsPath = @"%MyDocs%\Code Snippets\" + LanguageStringId + @"\My Code Snippets\";
using (Key forceSubKey = childKey.CreateSubkey("ForceCreateDirs")) {
forceSubKey.SetValue(LanguageStringId, myDocumentsPath);
}
using (Key pathsSubKey = childKey.CreateSubkey("Paths")) {
pathsSubKey.SetValue(LanguageStringId, myDocumentsPath);
}
}
}
示例8: Unregister
public override void Unregister(RegistrationContext context)
{
if (context != null)
{
context.RemoveKey(ProviderRegKey);
}
}
示例9: 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);
}
}
示例10: 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)
{
// Write to the context's log what we are about to do
context.Log.WriteLine(string.Format(CultureInfo.CurrentCulture, "SccProvider:\t\t{0}\n", RegName));
// Declare the source control provider, its name, the provider's service
// and aditionally the packages implementing this provider
using (Key sccProviders = context.CreateKey("SourceControlProviders"))
{
using (Key sccProviderKey = sccProviders.CreateSubkey(RegGuid.ToString("B")))
{
sccProviderKey.SetValue("", RegName);
sccProviderKey.SetValue("Service", SccProviderService.ToString("B"));
using (Key sccProviderNameKey = sccProviderKey.CreateSubkey("Name"))
{
sccProviderNameKey.SetValue("", UIName);
sccProviderNameKey.SetValue("Package", UINamePkg.ToString("B"));
sccProviderNameKey.Close();
}
// Additionally, you can create a "Packages" subkey where you can enumerate the dll
// that are used by the source control provider, something like "Package1"="SccProvider.dll"
// but this is not a requirement.
sccProviderKey.Close();
}
sccProviders.Close();
}
}
示例11: 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);
}
}
示例12: Register
/// <include file='doc\ProvideEditorFactoryAttribute.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_NotifyEditorFactory, FactoryType.Name));
using (Key childKey = context.CreateKey(EditorRegKey))
{
childKey.SetValue(string.Empty, FactoryType.Name);
childKey.SetValue("DisplayName", string.Format(CultureInfo.InvariantCulture, "#{0}", NameResourceID));
childKey.SetValue("Package", context.ComponentType.GUID.ToString("B"));
// Now report logical views for the editor factory.
//
using (Key viewKey = childKey.CreateSubkey("LogicalViews"))
{
TypeConverter converter = TypeDescriptor.GetConverter(typeof(LogicalView));
foreach(ProvideViewAttribute pva in FactoryType.GetCustomAttributes(typeof(ProvideViewAttribute), true)) {
if (pva.LogicalView != LogicalView.Primary) {
context.Log.WriteLine(SR.GetString(SR.Reg_NotifyEditorView, converter.ConvertToString(pva.LogicalView)));
Guid logicalView = (Guid)converter.ConvertTo(pva.LogicalView, typeof(Guid));
string physicalView = pva.PhysicalView;
if (physicalView == null) {
physicalView = string.Empty;
}
viewKey.SetValue(logicalView.ToString("B"), physicalView);
}
}
}
}
}
示例13: 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);
}
}
}
}
示例14: Register
public override void Register(RegistrationContext context)
{
using (var key = context.CreateKey(GetKeyName()))
{
key.SetValue(CommandUIGuid.ToString("B"), 1);
}
}
示例15: 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);
}
}