コード例 #1
0
 public static void Unregister(Type t)
 {
     try
     {
         ShellUtility.UnregisterVsShellContextMenuHandler(t.GUID, ".cs");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message); // Log the error
         throw;                         // Re-throw the exception
     }
 }
コード例 #2
0
 public static void Register(Type t)
 {
     try
     {
         ShellUtility.RegisterVsShellContextMenuHandler(t.GUID, ".sln",
                                                        "VsVsShellContextMenuHandler.Extension Class");
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message); // Log the error
         throw;                         // Re-throw the exception
     }
 }