In This Article

BarButtonCommand Class

Represents a bar button command.

public class BarButtonCommand : BarCommand, IImageListProvider, IBarCheckableCommand
Inheritance:
Object Command BarCommand Object
Implements:
IImageListProvider IBarCheckableCommand

Constructors

BarButtonCommand(String, String, String, Int32)

Initializes a new instance of the BarButtonCommand class.

public BarButtonCommand(string category, string name, string text, int imageIndex)
Parameter Type Description
category String

The category of the bar command.

name String

The name of the bar command.

text String

The text caption.

imageIndex Int32

The index of an image within an ImageList.

BarButtonCommand(String, String, String, Int32, Boolean, Boolean, Boolean)

Initializes a new instance of the BarButtonCommand class.

public BarButtonCommand(string category, string name, string text, int imageIndex, bool enabled, bool checkable, bool isChecked)
Parameter Type Description
category String

The category of the bar command.

name String

The name of the bar command.

text String

The text caption.

imageIndex Int32

The index of an image within an ImageList.

enabled Boolean

Whether the button is enabled.

checkable Boolean

Whether the button is checkable.

isChecked Boolean

Whether the button is currently checked.

Properties

Checkable

Gets or sets whether the button is checkable.

public bool Checkable { get; set; }

Property Value

Boolean:

true if the button is checkable; otherwise, false.

Checked

Gets or sets whether the button is checked.

public bool Checked { get; set; }

Property Value

Boolean:

true if the button is checked; otherwise, false.

CheckGroupName

Gets or sets the name of the check group.

public string CheckGroupName { get; set; }

Property Value

String:

The name of the check group.

Methods

CloneToType(Type)

Creates a copy of the BarCommand.

protected override BarCommand CloneToType(Type targetType)
Parameter Type Description
targetType Type

The target Type.

Returns

BarCommand:

The copy of the BarCommand.

Creates a new BarCommandLink for the command.

public override BarCommandLink CreateCommandLink()

Returns

BarCommandLink:

The BarCommandLink that was created.

OnClick(BarCommandLinkEventArgs)

Raises the Click event.

protected virtual void OnClick(BarCommandLinkEventArgs e)
Parameter Type Description
e BarCommandLinkEventArgs

A BarCommandLinkEventArgs that contains the event data.

RaiseClickEvent(BarCommandLinkEventArgs)

Raises the Click event.

public void RaiseClickEvent(BarCommandLinkEventArgs e)
Parameter Type Description
e BarCommandLinkEventArgs

A BarCommandLinkEventArgs that contains the event data.

ReadAttributesFromXml(BarLayoutXmlSerializer)

Deserializes the attribute data for the BarCommandLink from XML.

protected override void ReadAttributesFromXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

ResetCanCustomizeKeyboardShortcuts()

Resets the CanCustomizeKeyboardShortcuts property to its default value.

public override void ResetCanCustomizeKeyboardShortcuts()

ResetCheckable()

Resets the Checkable property to its default value.

public virtual void ResetCheckable()

ResetChecked()

Resets the Checked property to its default value.

public virtual void ResetChecked()

ResetCheckGroupName()

Resets the CheckGroupName property to its default value.

public virtual void ResetCheckGroupName()

ShouldSerializeCanCustomizeKeyboardShortcuts()

Indicates whether the CanCustomizeKeyboardShortcuts property should be persisted.

public override bool ShouldSerializeCanCustomizeKeyboardShortcuts()

Returns

Boolean:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCheckable()

Indicates whether the Checkable property should be persisted.

public virtual bool ShouldSerializeCheckable()

Returns

Boolean:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeChecked()

Indicates whether the Checked property should be persisted.

public virtual bool ShouldSerializeChecked()

Returns

Boolean:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeCheckGroupName()

Indicates whether the CheckGroupName property should be persisted.

public virtual bool ShouldSerializeCheckGroupName()

Returns

Boolean:

true if the property value has changed from its default; otherwise, false.

WriteAttributesToXml(BarLayoutXmlSerializer)

Serializes the attribute data for the BarCommand to XML.

protected override void WriteAttributesToXml(BarLayoutXmlSerializer serializer)
Parameter Type Description
serializer BarLayoutXmlSerializer

The BarLayoutXmlSerializer to use.

Events

Click

Occurs when a BarCommand is clicked.

public event BarCommandLinkEventHandler Click

Event Type

BarCommandLinkEventHandler

Inherited Members