public static void RegisterClass(Type t) { GuidAttribute guidAttribute = GetGuidAttribute(t); CustomToolAttribute customToolAttribute = GetCustomToolAttribute(t); using (RegistryKey key = Registry.LocalMachine.CreateSubKey(GetKeyName(CSharpCategoryGuid, customToolAttribute.Name))) { key.SetValue("", customToolAttribute.Description); key.SetValue("CLSID", "{" + guidAttribute.Value + "}"); key.SetValue("GeneratesDesignTimeSource", 1); } }
public static void UnregisterClass(Type t) { CustomToolAttribute customToolAttribute = GetCustomToolAttribute(t); Registry.LocalMachine.DeleteSubKey(GetKeyName(CSharpCategoryGuid, customToolAttribute.Name), false); }