StandardCommands 类
定义
定义可用于大多数应用程序的标准命令集的标识符。Defines identifiers for the standard set of commands that are available to most applications.
public ref class StandardCommands
public class StandardCommands
type StandardCommands = class
Public Class StandardCommands
- 继承
-
StandardCommands
- 派生
示例
下面的代码示例演示如何将类的成员添加 StandardCommands 到 MenuCommand ,以及如何将添加 MenuCommand 到 IMenuCommandService 。The following code example illustrates how to add a member of the StandardCommands class to a MenuCommand and how to add the MenuCommand to an IMenuCommandService.
public ref class CDesigner: public ComponentDesigner
{
public:
[PermissionSetAttribute(SecurityAction::Demand, Name="FullTrust")]
virtual void Initialize( IComponent^ comp ) override
{
ComponentDesigner::Initialize( comp );
IMenuCommandService^ mcs = static_cast<IMenuCommandService^>(comp->Site->GetService( IMenuCommandService::typeid ));
MenuCommand^ mc = gcnew MenuCommand( gcnew EventHandler( this, &CDesigner::OnF1Help ),StandardCommands::F1Help );
mc->Enabled = true;
mc->Visible = true;
mc->Supported = true;
mcs->AddCommand( mc );
System::Windows::Forms::MessageBox::Show( "Initialize() has been invoked." );
}
private:
void OnF1Help( Object^ /*sender*/, EventArgs^ /*e*/ )
{
System::Windows::Forms::MessageBox::Show( "F1Help has been invoked." );
}
};
}
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
public class CDesigner : System.ComponentModel.Design.ComponentDesigner
{
public override void Initialize(IComponent comp)
{
base.Initialize(comp);
IMenuCommandService mcs = (IMenuCommandService)comp.Site.
GetService(typeof(IMenuCommandService));
MenuCommand mc = new MenuCommand(new EventHandler(OnF1Help), StandardCommands.F1Help);
mc.Enabled = true;
mc.Visible = true;
mc.Supported = true;
mcs.AddCommand(mc);
System.Windows.Forms.MessageBox.Show("Initialize() has been invoked.");
}
private void OnF1Help(object sender, EventArgs e)
{
System.Windows.Forms.MessageBox.Show("F1Help has been invoked.");
}
}
<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Public Class CDesigner
Inherits System.ComponentModel.Design.ComponentDesigner
Public Overrides Sub Initialize(ByVal comp As IComponent)
MyBase.Initialize(comp)
Dim mcs As IMenuCommandService = CType(comp.Site.GetService(GetType(IMenuCommandService)), IMenuCommandService)
Dim mc As New MenuCommand(New EventHandler(AddressOf OnF1Help), StandardCommands.F1Help)
mc.Enabled = True
mc.Visible = True
mc.Supported = True
mcs.AddCommand(mc)
System.Windows.Forms.MessageBox.Show("Initialize() has been invoked.")
End Sub
Private Sub OnF1Help(ByVal sender As Object, ByVal e As EventArgs)
System.Windows.Forms.MessageBox.Show("F1Help has been invoked.")
End Sub
End Class
注解
此类定义 CommandID 可供设计器使用的标准命令的标识符。This class defines CommandID identifiers for standard commands that are available to designers.
若要将命令从 StandardCommands 类添加到设计器菜单,必须调用的 AddCommand 方法, IMenuCommandService 并从中添加一个 MenuCommand 包含的 CommandID StandardCommands 。To add a command from the StandardCommands class to a designer menu, you must call the AddCommand method of an IMenuCommandService and add a MenuCommand that contains a CommandID from StandardCommands.
构造函数
| StandardCommands() |
初始化 StandardCommands 类的新实例。Initializes a new instance of the StandardCommands class. |
字段
| AlignBottom |
获取“AlignBottom”命令的 CommandID。Gets the CommandID for the AlignBottom command. 此字段为只读。This field is read-only. |
| AlignHorizontalCenters |
获取“AlignHorizontalCenters”命令的 CommandID。Gets the CommandID for the AlignHorizontalCenters command. 此字段为只读。This field is read-only. |
| AlignLeft |
获取“AlignLeft”命令的 CommandID。Gets the CommandID for the AlignLeft command. 此字段为只读。This field is read-only. |
| AlignRight |
获取“AlignRight”命令的 CommandID。Gets the CommandID for the AlignRight command. 此字段为只读。This field is read-only. |
| AlignToGrid |
获取“AlignToGrid”命令的 CommandID。Gets the CommandID for the AlignToGrid command. 此字段为只读。This field is read-only. |
| AlignTop |
获取“AlignTop”命令的 CommandID。Gets the CommandID for the AlignTop command. 此字段为只读。This field is read-only. |
| AlignVerticalCenters |
获取“AlignVerticalCenters”命令的 CommandID。Gets the CommandID for the AlignVerticalCenters command. 此字段为只读。This field is read-only. |
| ArrangeBottom |
获取“ArrangeBottom”命令的 CommandID。Gets the CommandID for the ArrangeBottom command. 此字段为只读。This field is read-only. |
| ArrangeIcons |
获取“ArrangeIcons”命令的 CommandID。Gets the CommandID for the ArrangeIcons command. 此字段为只读。This field is read-only. |
| ArrangeRight |
获取“ArrangeRight”命令的 CommandID。Gets the CommandID for the ArrangeRight command. 此字段为只读。This field is read-only. |
| BringForward |
获取“BringForward”命令的 CommandID。Gets the CommandID for the BringForward command. 此字段为只读。This field is read-only. |
| BringToFront |
获取“BringToFront”命令的 CommandID。Gets the CommandID for the BringToFront command. 此字段为只读。This field is read-only. |
| CenterHorizontally |
获取“CenterHorizontally”命令的 CommandID。Gets the CommandID for the CenterHorizontally command. 此字段为只读。This field is read-only. |
| CenterVertically |
获取“CenterVertically”命令的 CommandID。Gets the CommandID for the CenterVertically command. 此字段为只读。This field is read-only. |
| Copy |
获取“Copy”命令的 CommandID。Gets the CommandID for the Copy command. 此字段为只读。This field is read-only. |
| Cut |
获取“Cut”命令的 CommandID。Gets the CommandID for the Cut command. 此字段为只读。This field is read-only. |
| Delete |
获取“Delete”命令的 CommandID。Gets the CommandID for the Delete command. 此字段为只读。This field is read-only. |
| DocumentOutline |
获取“Document Outline”命令的 CommandID。Gets the CommandID for the Document Outline command. 此字段为只读。This field is read-only. |
| F1Help |
获取“F1Help”命令的 CommandID。Gets the CommandID for the F1Help command. 此字段为只读。This field is read-only. |
| Group |
获取“Group”命令的 CommandID。Gets the CommandID for the Group command. 此字段为只读。This field is read-only. |
| HorizSpaceConcatenate |
获取“HorizSpaceConcatenate”命令的 CommandID。Gets the CommandID for the HorizSpaceConcatenate command. 此字段为只读。This field is read-only. |
| HorizSpaceDecrease |
获取“HorizSpaceDecrease”命令的 CommandID。Gets the CommandID for the HorizSpaceDecrease command. 此字段为只读。This field is read-only. |
| HorizSpaceIncrease |
获取“HorizSpaceIncrease”命令的 CommandID。Gets the CommandID for the HorizSpaceIncrease command. 此字段为只读。This field is read-only. |
| HorizSpaceMakeEqual |
获取“HorizSpaceMakeEqual”命令的 CommandID。Gets the CommandID for the HorizSpaceMakeEqual command. 此字段为只读。This field is read-only. |
| LineupIcons |
获取“LineupIcons”命令的 CommandID。Gets the CommandID for the LineupIcons command. 此字段为只读。This field is read-only. |
| LockControls |
获取“LockControls”命令的 CommandID。Gets the CommandID for the LockControls command. 此字段为只读。This field is read-only. |
| MultiLevelRedo |
获取“MultiLevelRedo”命令的 CommandID。Gets the CommandID for the MultiLevelRedo command. 此字段为只读。This field is read-only. |
| MultiLevelUndo |
获取“MultiLevelUndo”命令的 CommandID。Gets the CommandID for the MultiLevelUndo command. 此字段为只读。This field is read-only. |
| Paste |
获取“Paste”命令的 CommandID。Gets the CommandID for the Paste command. 此字段为只读。This field is read-only. |
| Properties |
获取“Properties”命令的 CommandID。Gets the CommandID for the Properties command. 此字段为只读。This field is read-only. |
| PropertiesWindow |
获取“PropertiesWindow”命令的 CommandID。Gets the CommandID for the PropertiesWindow command. 此字段为只读。This field is read-only. |
| Redo |
获取“Redo”命令的 CommandID。Gets the CommandID for the Redo command. 此字段为只读。This field is read-only. |
| Replace |
获取“Replace”命令的 CommandID。Gets the CommandID for the Replace command. 此字段为只读。This field is read-only. |
| SelectAll |
获取“SelectAll”命令的 CommandID。Gets the CommandID for the SelectAll command. 此字段为只读。This field is read-only. |
| SendBackward |
获取“SendBackward”命令的 CommandID。Gets the CommandID for the SendBackward command. 此字段为只读。This field is read-only. |
| SendToBack |
获取“SendToBack”命令的 CommandID。Gets the CommandID for the SendToBack command. 此字段为只读。This field is read-only. |
| ShowGrid |
获取“ShowGrid”命令的 CommandID。Gets the CommandID for the ShowGrid command. 此字段为只读。This field is read-only. |
| ShowLargeIcons |
获取“ShowLargeIcons”命令的 CommandID。Gets the CommandID for the ShowLargeIcons command. 此字段为只读。This field is read-only. |
| SizeToControl |
获取“SizeToControl”命令的 CommandID。Gets the CommandID for the SizeToControl command. 此字段为只读。This field is read-only. |
| SizeToControlHeight |
获取“SizeToControlHeight”命令的 CommandID。Gets the CommandID for the SizeToControlHeight command. 此字段为只读。This field is read-only. |
| SizeToControlWidth |
获取“SizeToControlWidth”命令的 CommandID。Gets the CommandID for the SizeToControlWidth command. 此字段为只读。This field is read-only. |
| SizeToFit |
获取“SizeToFit”命令的 CommandID。Gets the CommandID for the SizeToFit command. 此字段为只读。This field is read-only. |
| SizeToGrid |
获取“SizeToGrid”命令的 CommandID。Gets the CommandID for the SizeToGrid command. 此字段为只读。This field is read-only. |
| SnapToGrid |
获取“SnapToGrid”命令的 CommandID。Gets the CommandID for the SnapToGrid command. 此字段为只读。This field is read-only. |
| TabOrder |
获取“TabOrder”命令的 CommandID。Gets the CommandID for the TabOrder command. 此字段为只读。This field is read-only. |
| Undo |
获取“Undo”命令的 CommandID。Gets the CommandID for the Undo command. 此字段为只读。This field is read-only. |
| Ungroup |
获取“Ungroup”命令的 CommandID。Gets the CommandID for the Ungroup command. 此字段为只读。This field is read-only. |
| VerbFirst |
获取一组谓词中的第一个。Gets the first of a set of verbs. 此字段为只读。This field is read-only. |
| VerbLast |
获取一组谓词中的最后一个。Gets the last of a set of verbs. 此字段为只读。This field is read-only. |
| VertSpaceConcatenate |
获取“VertSpaceConcatenate”命令的 CommandID。Gets the CommandID for the VertSpaceConcatenate command. 此字段为只读。This field is read-only. |
| VertSpaceDecrease |
获取“VertSpaceDecrease”命令的 CommandID。Gets the CommandID for the VertSpaceDecrease command. 此字段为只读。This field is read-only. |
| VertSpaceIncrease |
获取“VertSpaceIncrease”命令的 CommandID。Gets the CommandID for the VertSpaceIncrease command. 此字段为只读。This field is read-only. |
| VertSpaceMakeEqual |
获取“VertSpaceMakeEqual”命令的 CommandID。Gets the CommandID for the VertSpaceMakeEqual command. 此字段为只读。This field is read-only. |
| ViewCode |
获取“ViewCode”命令的 CommandID。Gets the CommandID for the ViewCode command. 此字段为只读。This field is read-only. |
| ViewGrid |
获取“ViewGrid”命令的 CommandID。Gets the CommandID for the ViewGrid command. 此字段为只读。This field is read-only. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |