public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { using (var key = packageKey.CreateSubKey("ApplicationIcon")) { key.SetValue(null, FileName); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { using (var key = packageKey.CreateSubKey("CommandLine\\" + Name)) { key.SetValue("ExpectArgument", ExpectArgument ? 1 : 0); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string keyName; if (ProjectGuid.HasValue) { keyName = "Projects\\" + ProjectGuid.Value.ToString("B").ToUpperInvariant() + "\\Extensions\\" + Extension; } else { keyName = "Extensions\\" + Extension; } using (var key = packageKey.CreateSubKey(keyName)) { if (DefaultName != null) { key.SetValue(null, ResolveStringResource(package, DefaultName)); key.SetValue("DefaultName", DefaultName); } key.SetValue("FactoryType", FactoryType.GUID.ToString("B").ToUpperInvariant()); key.SetValue("Priority", Priority); if (TemplateResource != null) { key.SetValue("TemplateResource", TemplateResource); } } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string guid = Type.GUID.ToString("B").ToUpperInvariant(); using (var key = packageKey.CreateSubKey("CLSID\\" + guid)) { key.SetValue("Class", Type.AssemblyQualifiedName); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string factoryGuid = FactoryType.GUID.ToString("B").ToUpperInvariant(); using (var key = packageKey.CreateSubKey("Editors\\" + factoryGuid)) { key.SetValue(null, ResolveStringResource(package, Name)); key.SetValue("DisplayName", Name); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string toolWindowGuid = ToolType.GUID.ToString("B").ToUpperInvariant(); using (var key = packageKey.CreateSubKey("ToolWindows\\" + toolWindowGuid)) { key.SetValue("Style", Style.ToString()); key.SetValue("Orientation", Orientation.ToString()); key.SetValue("MultipleInstances", MultipleInstances ? 1 : 0); key.SetValue("Transient", Transient ? 1 : 0); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string factoryGuid = FactoryType.GUID.ToString("B").ToUpperInvariant(); using (var key = packageKey.CreateSubKey("Projects\\" + factoryGuid)) { key.SetValue(null, ResolveStringResource(package, Name)); key.SetValue("DisplayName", Name); key.SetValue("ProjectFileExtensions", ProjectFileExtensions); key.SetValue("DefaultProjectExtension", DefaultProjectExtension); key.SetValue("PossibleProjectExtensions", PossibleProjectExtensions); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string optionPageGuid = PageType.GUID.ToString("B").ToUpperInvariant(); using (var key = packageKey.CreateSubKey("OptionPages\\" + optionPageGuid)) { key.SetValue("Class", PageType.AssemblyQualifiedName); key.SetValue("CategoryName", CategoryName); key.SetValue("PageName", PageName); if (CategoryNameResourceKey != null) key.SetValue("CategoryNameResourceKey", CategoryNameResourceKey); if (PageNameResourceKey != null) key.SetValue("PageNameResourceKey", PageNameResourceKey); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { foreach (var entry in HighlightingManager.Manager.HighlightingDefinitions.Values.OfType<DictionaryEntry>()) { var syntaxMode = (SyntaxMode)entry.Key; foreach (string extension in syntaxMode.Extensions) { var attribute = new ProvideEditorExtensionAttribute(typeof(TextEditorFactory), extension, 100) { DefaultName = syntaxMode.Name }; attribute.Register(package, context, packageKey); } } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { foreach (var entry in HighlightingManager.Manager.HighlightingDefinitions.Values.OfType <DictionaryEntry>()) { var syntaxMode = (SyntaxMode)entry.Key; foreach (string extension in syntaxMode.Extensions) { var attribute = new ProvideEditorExtensionAttribute(typeof(TextEditorFactory), extension, 100) { DefaultName = syntaxMode.Name }; attribute.Register(package, context, packageKey); } } }
public HResult Register(INiRegistrationContext registrationContext) { try { if (registrationContext == null) { throw new ArgumentNullException("registrationContext"); } var packageGuid = GetType().GUID.ToString("B").ToUpperInvariant(); var descriptionAttribute = GetType().GetCustomAttributes(typeof(DescriptionAttribute), true).Cast <DescriptionAttribute>().SingleOrDefault(); string description = descriptionAttribute != null ? descriptionAttribute.Description : registrationContext.PackageId; using (var key = registrationContext.CreateKey("Packages\\" + packageGuid)) { key.SetValue(null, this.ResolveStringResource(description)); foreach (var type in GetType().Assembly.GetTypes()) { foreach (RegistrationAttribute attribute in type.GetCustomAttributes(typeof(RegistrationAttribute), true)) { attribute.Register(this, registrationContext, key); } } } using (var key = registrationContext.CreateKey("InstalledProducts\\" + registrationContext.PackageId)) { key.SetValue(null, description); key.SetValue("Package", packageGuid); key.SetValue("Version", GetType().Assembly.GetName().Version.ToString()); } // Add the installed products key. return(HResult.OK); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string optionPageGuid = PageType.GUID.ToString("B").ToUpperInvariant(); using (var key = packageKey.CreateSubKey("OptionPages\\" + optionPageGuid)) { key.SetValue("Class", PageType.AssemblyQualifiedName); key.SetValue("CategoryName", CategoryName); key.SetValue("PageName", PageName); if (CategoryNameResourceKey != null) { key.SetValue("CategoryNameResourceKey", CategoryNameResourceKey); } if (PageNameResourceKey != null) { key.SetValue("PageNameResourceKey", PageNameResourceKey); } } }
public HResult Unregister(INiRegistrationContext registrationContext) { try { if (registrationContext == null) { throw new ArgumentNullException("registrationContext"); } var packageGuid = GetType().GUID.ToString("B").ToUpperInvariant(); using (var key = registrationContext.CreateKey("Packages\\" + packageGuid)) { foreach (var type in GetType().Assembly.GetTypes()) { foreach (RegistrationAttribute attribute in type.GetCustomAttributes(typeof(RegistrationAttribute), true)) { attribute.Unregister(this, registrationContext, key); } } } // Un-registration allows attributes to perform cleanup other // than from inside the package namespace. The package namespace // itself is unconditionally deleted anyway, so the attributes // don't have to clean up that. registrationContext.RemoveKey("Packages\\" + packageGuid); registrationContext.RemoveKey("InstalledProducts\\" + registrationContext.PackageId); return(HResult.OK); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public override void Register(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { string keyName; if (ProjectGuid.HasValue) keyName = "Projects\\" + ProjectGuid.Value.ToString("B").ToUpperInvariant() + "\\Extensions\\" + Extension; else keyName = "Extensions\\" + Extension; using (var key = packageKey.CreateSubKey(keyName)) { if (DefaultName != null) { key.SetValue(null, ResolveStringResource(package, DefaultName)); key.SetValue("DefaultName", DefaultName); } key.SetValue("FactoryType", FactoryType.GUID.ToString("B").ToUpperInvariant()); key.SetValue("Priority", Priority); if (TemplateResource != null) key.SetValue("TemplateResource", TemplateResource); } }
public override void Unregister(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey) { }
public abstract void Unregister(INiPackage package, INiRegistrationContext context, INiRegistrationKey packageKey);
public HResult Unregister(INiRegistrationContext registrationContext) { try { if (registrationContext == null) throw new ArgumentNullException("registrationContext"); var packageGuid = GetType().GUID.ToString("B").ToUpperInvariant(); using (var key = registrationContext.CreateKey("Packages\\" + packageGuid)) { foreach (var type in GetType().Assembly.GetTypes()) { foreach (RegistrationAttribute attribute in type.GetCustomAttributes(typeof(RegistrationAttribute), true)) { attribute.Unregister(this, registrationContext, key); } } } // Un-registration allows attributes to perform cleanup other // than from inside the package namespace. The package namespace // itself is unconditionally deleted anyway, so the attributes // don't have to clean up that. registrationContext.RemoveKey("Packages\\" + packageGuid); registrationContext.RemoveKey("InstalledProducts\\" + registrationContext.PackageId); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }
public HResult Register(INiRegistrationContext registrationContext) { try { if (registrationContext == null) throw new ArgumentNullException("registrationContext"); var packageGuid = GetType().GUID.ToString("B").ToUpperInvariant(); var descriptionAttribute = GetType().GetCustomAttributes(typeof(DescriptionAttribute), true).Cast<DescriptionAttribute>().SingleOrDefault(); string description = descriptionAttribute != null ? descriptionAttribute.Description : registrationContext.PackageId; using (var key = registrationContext.CreateKey("Packages\\" + packageGuid)) { key.SetValue(null, this.ResolveStringResource(description)); foreach (var type in GetType().Assembly.GetTypes()) { foreach (RegistrationAttribute attribute in type.GetCustomAttributes(typeof(RegistrationAttribute), true)) { attribute.Register(this, registrationContext, key); } } } using (var key = registrationContext.CreateKey("InstalledProducts\\" + registrationContext.PackageId)) { key.SetValue(null, description); key.SetValue("Package", packageGuid); key.SetValue("Version", GetType().Assembly.GetName().Version.ToString()); } // Add the installed products key. return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }