The Labs \ Source Viewer \ SSCLI \ System.ComponentModel.Design \ IMenuCommandService

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IMenuCommandService.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. /*
  16. */
  17. namespace System.ComponentModel.Design
  18. {
  19.     using System.Runtime.Remoting;
  20.     using System.ComponentModel;
  21.    
  22.     using System.Diagnostics;
  23.    
  24.     using System;
  25.    
  26.     /// <devdoc>
  27.     /// <para>Provides an interface for a designer to add menu items to the Visual Studio
  28.     /// 7.0 menu.</para>
  29.     /// </devdoc>
  30.     [System.Runtime.InteropServices.ComVisible(true)]
  31.     public interface IMenuCommandService
  32.     {
  33.        
  34.         /// <devdoc>
  35.         /// <para>Gets or sets an array of type <see cref='System.ComponentModel.Design.DesignerVerb'/>
  36.         /// that indicates the verbs that are currently available.</para>
  37.         /// </devdoc>
  38.         DesignerVerbCollection Verbs {
  39.             get;
  40.         }
  41.        
  42.         /// <devdoc>
  43.         /// <para>
  44.         /// Adds a menu command to the document.
  45.         /// </para>
  46.         /// </devdoc>
  47.         void AddCommand(MenuCommand command);
  48.        
  49.         /// <devdoc>
  50.         /// <para>
  51.         /// Adds a verb to the set of global verbs.
  52.         /// </para>
  53.         /// </devdoc>
  54.         void AddVerb(DesignerVerb verb);
  55.        
  56.         /// <devdoc>
  57.         /// <para>
  58.         /// Searches for the given command ID and returns
  59.         /// the <see cref='System.ComponentModel.Design.MenuCommand'/>
  60.         /// associated with it.
  61.         /// </para>
  62.         /// </devdoc>
  63.         MenuCommand FindCommand(CommandID commandID);
  64.        
  65.         /// <devdoc>
  66.         /// <para>Invokes a command on the local form or in the global environment.</para>
  67.         /// </devdoc>
  68.         bool GlobalInvoke(CommandID commandID);
  69.        
  70.         /// <devdoc>
  71.         /// <para>
  72.         /// Removes the specified <see cref='System.ComponentModel.Design.MenuCommand'/> from the document.
  73.         /// </para>
  74.         /// </devdoc>
  75.         void RemoveCommand(MenuCommand command);
  76.        
  77.         /// <devdoc>
  78.         /// <para>
  79.         /// Removes the specified verb from the document.
  80.         /// </para>
  81.         /// </devdoc>
  82.         void RemoveVerb(DesignerVerb verb);
  83.        
  84.         /// <devdoc>
  85.         /// <para>Shows the context menu with the specified command ID at the specified
  86.         /// location.</para>
  87.         /// </devdoc>
  88.         void ShowContextMenu(CommandID menuID, int x, int y);
  89.     }
  90. }

Developer Fusion