BarCommandLink Class
Provides the base requirements for a bar command link.
public abstract class BarCommandLink : UIElement, IInputElement, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable, IImageListProvider
- Inheritance:
- object MarshalByRefObject DisposableObject LogicalTreeNodeBase UIElement object
- Derived:
- BarButtonLink BarCustomControlLink BarExpanderButtonLink BarLabelLink BarPopupButtonLink BarSplitButtonLink
- Implements:
- IInputElement IUIElement ILogicalTreeNode IDpiAwareElement IDisposable IImageListProvider
Constructors
BarCommandLink(BarCommand)
Initializes a new instance of the BarCommandLink
class.
public BarCommandLink(BarCommand command)
Parameter | Type | Description |
---|---|---|
command | BarCommand | The BarCommand upon which the link is based. |
Properties
BarControl
Gets the IBarControl that contains the link.
[Browsable(false)]
public IBarControl BarControl { get; }
Property Value
- IBarControl:
The IBarControl that contains the link.
BeginAGroup
Gets or sets whether the command link begins a group.
public bool BeginAGroup { get; set; }
Property Value
- bool:
true
if the command link begins a group; otherwise,false
.
CommandCore
Gets the BarCommand to link to.
[Browsable(false)]
public BarCommand CommandCore { get; }
Property Value
- BarCommand:
The BarCommand to link to.
DefaultImage
Gets or sets the default image that is displayed for the bar command link that overrides the default bar command image.
[Browsable(false)]
public Image DefaultImage { get; set; }
Property Value
- Image:
The default
Image
displayed for the bar command link that overrides the default bar command image. The default value isnull
.
DefaultText
Gets or sets the default text of the bar command link that overrides the default bar command text.
[Browsable(false)]
public string DefaultText { get; set; }
Property Value
- string:
The default text of the bar command link that overrides the default bar command text.
DisplayStyle
Gets or sets the display style of the command link.
public BarCommandLinkDisplayStyle DisplayStyle { get; set; }
Property Value
- BarCommandLinkDisplayStyle:
A BarCommandLinkDisplayStyle specifying the display style of the command link.
Enabled
Gets or sets whether the command link is enabled.
public DefaultableBoolean Enabled { get; set; }
Property Value
- DefaultableBoolean:
A DefaultableBoolean indicating if the command link is enabled. If its value is
Default
, then the value of the Enabled property is used.
HasImage
Gets whether the command link has an image that can be displayed.
[Browsable(false)]
public virtual bool HasImage { get; }
Property Value
- bool:
true
if the command link has an image that can be displayed; otherwise,false
.
Image
Gets or sets the image that is displayed for the bar command link that overrides the default bar command image.
public Image Image { get; set; }
Property Value
- Image:
The
Image
displayed for the bar command link that overrides the default bar command image. The default value isnull
.
ImageIndex
Gets or sets the index of an image within an ImageList
that overrides the default bar command image.
[ImageIndex]
[TypeConverter(typeof(ImageIndexConverter))]
public int ImageIndex { get; set; }
Property Value
- int:
The index of an image within an
ImageList
that overrides the default bar command image. The default value is-1
.
InvalidateOnMouseEvents
Gets whether to invalidate the element when mouse events occur.
protected override bool InvalidateOnMouseEvents { get; }
Property Value
- bool:
true
if the element should be invalidated when mouse events occur.
IsClickableInCustomizeMode
Gets whether the link is clickable in customize mode.
protected virtual bool IsClickableInCustomizeMode { get; }
Property Value
- bool:
true
if the link is clickable in customize mode; otherwise,false
.
IsMergeModified
Gets whether the command link has been modified from a merge operation.
[Browsable(false)]
public bool IsMergeModified { get; }
Property Value
- bool:
true
if the command link has been modified from a merge operation; otherwise,false
.
IsSelected
Gets whether the command link is selected in its parent IBarControl.
[Browsable(false)]
public bool IsSelected { get; }
Property Value
- bool:
true
if the command link is selected in its parent IBarControl; otherwise,false
.
MergeAction
Gets or sets the type of merge action to perform on the link when it is merged onto another IBarControl.
public BarMergeAction MergeAction { get; set; }
Property Value
- BarMergeAction:
A BarMergeAction indicating the type of merge action to perform on the link when it is merged onto another IBarControl.
MergeKey
Gets or sets the key to use when merging links, if the command's full name should not be used.
public string MergeKey { get; set; }
Property Value
- string:
The key to use when merging links, if the command's full name should not be used.
Remarks
The resolved merge key defaults to the command's full name, unless this property overrides it. If the command link is a merge source command link, the resolved merge key looks for a match on the target command link collection. If the command link is a merge target command link, the resolved merge key is used for matching against source command links.
Mnemonic
Gets a value indicating the mnemonic character that is associated with this command link.
[Browsable(false)]
public char Mnemonic { get; }
Property Value
- char:
A character that represents the mnemonic character associated with this command link. Returns the null character
'\0'
if no mnemonic character is specified in the text of the command link.
ScreenBounds
Gets the screen bounds of the command link.
[Browsable(false)]
public Rectangle ScreenBounds { get; }
Property Value
- Rectangle:
The screen bounds of the command link.
Tag
Gets or sets the object that contains user-defined data about the object.
[TypeConverter(typeof(StringConverter))]
public object Tag { get; set; }
Property Value
Remarks
Any type derived from the object class can be assigned to this property.
Text
Gets or sets the text of the bar command link that overrides the default bar command text.
public string Text { get; set; }
Property Value
- string:
The text of the bar command link that overrides the default bar command text.
Visible
Gets or sets whether the command link should be visible if space permits.
public bool Visible { get; set; }
Property Value
- bool:
true
if the command link should be visible if space permits; otherwise,false
.
VisibleCore
Gets or sets whether the command link is visible.
protected virtual bool VisibleCore { get; set; }
Property Value
- bool:
true
if the command link is visible; otherwise,false
.
Methods
Clone()
Creates a copy of the BarCommandLink.
GetEnabled()
Gets the whether the command link is enabled.
public virtual bool GetEnabled()
Returns
- bool:
true
if the command link is enabled; otherwise,false
.
Remarks
This method resolves Enabled property with the Enabled setting on the bar command.
GetImage()
Gets the Image to use for the command link.
GetImageSize()
Gets the size of the Image to use for the command link.
GetMnemonic()
Gets the mnemonic for this link.
protected virtual char GetMnemonic()
Returns
- char:
The mnemonic character for this link.
Remarks
This method is called after a command's Text property changes.
GetText()
Gets the text to use for the command link.
public virtual string GetText()
Returns
- string:
The text to use for the command link.
Remarks
This method resolves the text to display in the user interface for the command link.
GetToolTipText()
Gets the text to use for the command link tooltips.
public virtual string GetToolTipText()
Returns
- string:
The text to use for the command link tooltips.
IsDifferentFromDefault(BarCommandLink)
Returns whether the command link is different from the specified BarCommandLink.
protected virtual bool IsDifferentFromDefault(BarCommandLink defaultCommandLink)
Parameter | Type | Description |
---|---|---|
defaultCommandLink | BarCommandLink | The BarCommandLink to examine. |
Returns
- bool:
true if the command link is different from the specified BarCommandLink.
MeasureOverride(Graphics, Size)
Measures the size in layout required for child elements and determines a size for the element itself.
protected override Size MeasureOverride(Graphics g, Size availableSize)
Parameter | Type | Description |
---|---|---|
g | Graphics | The Graphics object to use for measurement. |
availableSize | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
Remarks
Element authors should override this method, call Measure
on each visible child element and determine the total size required.
OnEnabledChanged(EventArgs)
Raises the Enabled event.
protected virtual void OnEnabledChanged(EventArgs e)
Parameter | Type | Description |
---|---|---|
e | EventArgs | An |
OnIsSelectedChanged(EventArgs)
Occurs when the value of the IsSelected property changes.
protected virtual void OnIsSelectedChanged(EventArgs e)
Parameter | Type | Description |
---|---|---|
e | EventArgs | An |
OnMouseEnter(MouseEventArgs)
Raises the MouseEnter event.
protected override void OnMouseEnter(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseEventArgs | A |
OnMouseLeave(MouseEventArgs)
Raises the MouseLeave event.
protected override void OnMouseLeave(MouseEventArgs e)
Parameter | Type | Description |
---|---|---|
e | MouseEventArgs | A |
OnParentChanged()
Invoked when logical parent is changed. This is invoked after the parent has changed, and the purpose is to allow elements to perform actions based on the changed parent.
protected override void OnParentChanged()
Process(BarProcessEventArgs)
Performs processing based on some sort of event.
protected virtual void Process(BarProcessEventArgs e)
Parameter | Type | Description |
---|---|---|
e | BarProcessEventArgs | A |
ProcessKeyDown(Keys)
Process a key that is pressed down.
protected virtual DefaultableBoolean ProcessKeyDown(Keys key)
Parameter | Type | Description |
---|---|---|
key | Keys | A Keys indicating the key that was pressed. |
Returns
- DefaultableBoolean:
DefaultableBoolean.True
if the key was handled.DefaultableBoolean.Default
if the key was not handled but should be allowed to process to the appropriate control.DefaultableBoolean.False
if the key was not handled and the BarManager should process the key.
ReadAttributesFromXml(BarLayoutXmlSerializer)
Deserializes the attribute data for the BarCommandLink from XML.
protected virtual void ReadAttributesFromXml(BarLayoutXmlSerializer serializer)
Parameter | Type | Description |
---|---|---|
serializer | BarLayoutXmlSerializer | The BarLayoutXmlSerializer to use. |
ReadElementFromXml(BarLayoutXmlSerializer)
Deserializes a child element for the BarCommandLink from XML.
protected virtual void ReadElementFromXml(BarLayoutXmlSerializer serializer)
Parameter | Type | Description |
---|---|---|
serializer | BarLayoutXmlSerializer | The BarLayoutXmlSerializer to use. |
ResetBeginAGroup()
Resets the BeginAGroup property to its default value.
public virtual void ResetBeginAGroup()
ResetDefaultImage()
Resets the DefaultImage property to its default value.
public virtual void ResetDefaultImage()
ResetDefaultText()
Resets the DefaultText property to its default value.
public virtual void ResetDefaultText()
ResetDisplayStyle()
Resets the DisplayStyle property to its default value.
public virtual void ResetDisplayStyle()
ResetEnabled()
Resets the Enabled property to its default value.
public virtual void ResetEnabled()
ResetImage()
Resets the Image property to its default value.
public virtual void ResetImage()
ResetImageIndex()
Resets the ImageIndex property to its default value.
public virtual void ResetImageIndex()
ResetMergeAction()
Resets the MergeAction property to its default value.
public virtual void ResetMergeAction()
ResetMergeKey()
Resets the MergeKey property to its default value.
public virtual void ResetMergeKey()
ResetText()
Resets the Text property to its default value.
public virtual void ResetText()
ResetVisible()
Resets the Visible property to its default value.
public virtual void ResetVisible()
ShouldDisplayImage()
Gets whether an image should be displayed for the item in its current location.
public bool ShouldDisplayImage()
Returns
- bool:
true
if an image should be displayed; otherwise,false
.
ShouldDisplayText()
Gets whether text should be displayed for the item in its current location.
ShouldSerializeBeginAGroup()
Indicates whether the BeginAGroup property should be persisted.
public virtual bool ShouldSerializeBeginAGroup()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeDefaultImage()
Indicates whether the DefaultImage property should be persisted.
public virtual bool ShouldSerializeDefaultImage()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeDefaultText()
Indicates whether the DefaultText property should be persisted.
public virtual bool ShouldSerializeDefaultText()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeDisplayStyle()
Indicates whether the DisplayStyle property should be persisted.
public virtual bool ShouldSerializeDisplayStyle()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeEnabled()
Indicates whether the Enabled property should be persisted.
public virtual bool ShouldSerializeEnabled()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeImage()
Indicates whether the Image property should be persisted.
public virtual bool ShouldSerializeImage()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeImageIndex()
Indicates whether the ImageIndex property should be persisted.
public virtual bool ShouldSerializeImageIndex()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeMergeAction()
Indicates whether the MergeAction property should be persisted.
public virtual bool ShouldSerializeMergeAction()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeMergeKey()
Indicates whether the MergeKey property should be persisted.
public virtual bool ShouldSerializeMergeKey()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeText()
Indicates whether the Text property should be persisted.
public virtual bool ShouldSerializeText()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeVisible()
Indicates whether the Visible property should be persisted.
public virtual bool ShouldSerializeVisible()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
WriteAttributesToXml(BarLayoutXmlSerializer, BarCommandLink)
Serializes the attribute data for the BarCommandLink to XML.
protected virtual void WriteAttributesToXml(BarLayoutXmlSerializer serializer, BarCommandLink defaultCommandLink)
Parameter | Type | Description |
---|---|---|
serializer | BarLayoutXmlSerializer | The BarLayoutXmlSerializer to use. |
defaultCommandLink | BarCommandLink | The default BarCommandLink that is used for differential layout comparison. |
WriteElementsToXml(BarLayoutXmlSerializer, BarCommandLink)
Serializes the child element data for the BarCommandLink to XML.
protected virtual void WriteElementsToXml(BarLayoutXmlSerializer serializer, BarCommandLink defaultCommandLink)
Parameter | Type | Description |
---|---|---|
serializer | BarLayoutXmlSerializer | The BarLayoutXmlSerializer to use. |
defaultCommandLink | BarCommandLink | The default BarCommandLink that is used for differential layout comparison. |
Inherited Members
- UIElement.logger
- UIElement.Dispose(bool)
- UIElement.AddPendingGraphicsInversion(Rectangle)
- UIElement.AddPendingScrollOperation(Rectangle, Orientation, int)
- UIElement.AddPendingScrollOperation(Rectangle, int, int)
- UIElement.Arrange(Rectangle)
- UIElement.ArrangeOverride(Size)
- UIElement.CaptureMouse()
- UIElement.ContainsLocation(Point)
- UIElement.CreateGraphics()
- UIElement.DpiScaleChanged(SizeF)
- UIElement.GetCursor(Point)
- UIElement.Invalidate()
- UIElement.Invalidate(Rectangle)
- UIElement.Invalidate(InvalidationLevels, InvalidationTypes)
- UIElement.InvalidateArrange()
- UIElement.InvalidateMeasure()
- UIElement.Measure(Graphics, Size)
- UIElement.OnClick(MouseEventArgs)
- UIElement.OnDoubleClick(MouseEventArgs)
- UIElement.OnMouseCaptureLost(EventArgs)
- UIElement.OnMouseDown(MouseEventArgs)
- UIElement.OnMouseHover(MouseEventArgs)
- UIElement.OnMouseMove(MouseEventArgs)
- UIElement.OnMouseUp(MouseEventArgs)
- UIElement.OnMouseWheel(MouseEventArgs)
- UIElement.OnRender(PaintEventArgs)
- UIElement.OnRenderChildElements(PaintEventArgs)
- UIElement.OnResize(EventArgs)
- UIElement.PostArrangeOverride()
- UIElement.ReleaseMouseCapture()
- UIElement.Render(PaintEventArgs)
- UIElement.TransformToAncestor(IUIElement)
- UIElement.TransformToDescendant(IUIElement)
- UIElement.UpdateLayout()
- UIElement.ActualHeight
- UIElement.ActualWidth
- UIElement.Bounds
- UIElement.CaptureMouseWhenPressed
- UIElement.ClipBounds
- UIElement.DesiredSize
- UIElement.DpiScaleFactor
- UIElement.IsArrangeValid
- UIElement.IsMeasureValid
- UIElement.IsMouseCaptured
- UIElement.IsRightToLeft
- UIElement.Size
- UIElement.VisualOffset
- UIElement.Click
- UIElement.DoubleClick
- UIElement.MouseCaptureLost
- UIElement.MouseDown
- UIElement.MouseEnter
- UIElement.MouseHover
- UIElement.MouseLeave
- UIElement.MouseMove
- UIElement.MouseUp
- UIElement.MouseWheel
- UIElement.Resize
- LogicalTreeNodeBase.CreateChildren()
- DisposableObject.Dispose()
- DisposableObject.VerifyNotDisposed()
- DisposableObject.IsDisposed
- DisposableObject.Disposed
- MarshalByRefObject.GetLifetimeService()
- MarshalByRefObject.InitializeLifetimeService()
- MarshalByRefObject.MemberwiseClone(bool)
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()