Class BarItems
Represents a collection of BarItem objects.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools.XPMenus
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class BarItems : VisuallyInheritableList, IList, ICollection, IEnumerable, ICloneable, IDisposable
Remarks
This class represents a collection of BarItem objects stored in a BarManager, ParentBarItem or XPToolBar.
Examples
Take a look at our XPMenus samples under the Tools\Samples\Menus Package folder for usage example.
Constructors
BarItems()
Overloaded. The constructor that instantiates a BarItems class.
Declaration
public BarItems()
BarItems(BarItem[])
The constructor that instantiates a BarItems class and intializes it with the supplied array of BarItems.
Declaration
public BarItems(BarItem[] barItems)
Parameters
| Type | Name | Description |
|---|---|---|
| BarItem[] | barItems | An array of BarItem(s). |
BarItems(BarManager)
The constructor that instantiates a BarItems class and sets its BarManager to the specified BarManager.
Declaration
public BarItems(BarManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| BarManager | manager | A BarManager instance. |
Properties
Item[BarItemID]
Returns a BarItem based on it's BarItemId.
Declaration
public BarItem this[BarItemID barItemId] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| BarItemID | barItemId |
Property Value
| Type |
|---|
| BarItem |
Item[Int32]
Gets or sets a reference to the BarItem at the specified index location in the BarItems object. In C#, this property is the indexer for the BarItems class.
Declaration
public BarItem this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The location of the BarItem in the BarItems collection. |
Property Value
| Type | Description |
|---|---|
| BarItem | The reference to the BarItem. |
Item[String]
Returns a BarItem based on it's BarItemId string.
Declaration
public BarItem this[string barItemId] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | barItemId |
Property Value
| Type |
|---|
| BarItem |
Manager
Gets or sets the BarManager to which this collection will be associated with.
Declaration
public BarManager Manager { get; set; }
Property Value
| Type |
|---|
| BarManager |
Remarks
The BarManager to which this BarItems collection will be associated with.
When this collection is associated with a BarManager, all the existing and any newly added BarItem child's Manager property will be reset to this Manager property.
Methods
Add(Object)
Override. See Add(Object).
Declaration
public override int Add(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value |
Returns
| Type |
|---|
| System.Int32 |
Overrides
AddHandlers(Object)
Declaration
protected override void AddHandlers(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item |
Overrides
AddRange(BarItem[])
Adds an array of BarItem objects to the collection.
Declaration
public virtual void AddRange(BarItem[] items)
Parameters
| Type | Name | Description |
|---|---|---|
| BarItem[] | items | An array of BarItem objects to add to the collection. |
Clear()
To clear the BarItem.
Declaration
public override void Clear()
Overrides
Dispose()
Declaration
public virtual void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
FindItem(String)
Overloaded. Finds a BarItem in the list given it's ID.
Declaration
public BarItem FindItem(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | The BarItem's ID. |
Returns
| Type | Description |
|---|---|
| BarItem | A BarItem with the specified ID. Null, if not found. |
FindItem(String, Int32)
Finds a BarItem in the list given it's text and categoryIndex value.
Declaration
public BarItem FindItem(string text, int categoryIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The BarItem's text value. |
| System.Int32 | categoryIndex | The BarItem's category Index value. |
Returns
| Type | Description |
|---|---|
| BarItem | A BarItem with the specified text and categoryIndex. Null, if not found. |
Remarks
If there are multiple bar items with the same text and categoryindex value, then the BarItem returned will be one of those in random.
FindMergePosition(Int32)
Declaration
public virtual int FindMergePosition(int mergeOrder)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | mergeOrder |
Returns
| Type |
|---|
| System.Int32 |
FindNestedItem(String)
Finds the nested BarItem in XPToolbar.
Declaration
public BarItem FindNestedItem(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | The baritem ID. |
Returns
| Type | Description |
|---|---|
| BarItem | The baritem containing the id |
Remarks
The method can be used to iterate through all items in XPToolBar to find the item containing the mentioned ID.
GetItemFromHotKey(Char)
Returns the BarItem that has this hotkey in the list, if any.
Declaration
public BarItem GetItemFromHotKey(char hotkey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char | hotkey | The hotkey for which to retrieve the BarItem. |
Returns
| Type | Description |
|---|---|
| BarItem | The BarItem if found; null otherwise. |
Insert(Int32, Object)
Override. See Insert(Int32, Object).
Declaration
public override void Insert(int index, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | |
| System.Object | value |
Overrides
InsertRange(Int32, ICollection)
Override. See InsertRange(Int32, ICollection).
Declaration
public override void InsertRange(int index, ICollection c)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | |
| System.Collections.ICollection | c |
Overrides
IsValidItemID(BarItem, String)
Tests whether a BarItem will be unique when added to this list with the specified text and categoryID. A reference to the BarItem itself is passed so that the BarItem if already in the list will be ignored in the test for uniqueness.
Declaration
public bool IsValidItemID(BarItem itemToValidate, string newID)
Parameters
| Type | Name | Description |
|---|---|---|
| BarItem | itemToValidate | The BarItem to validate for uniqueness. |
| System.String | newID | The text value of the BarItem when it will get added to the list. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the BarItem will make a unique entry in the list; false if not. |
OnItemPropertyChanged(Object, SyncfusionPropertyChangedEventArgs)
Overridden. See OnItemPropertyChanged(Object, SyncfusionPropertyChangedEventArgs).
Declaration
protected override void OnItemPropertyChanged(object sender, SyncfusionPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | Event sender. |
| SyncfusionPropertyChangedEventArgs | e | Event data. |
Overrides
ReleaseHandler(Object)
Declaration
protected override void ReleaseHandler(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item |
Overrides
Remove(Object)
To remove the BarItem.
Declaration
public override void Remove(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Overrides
RemoveAt(Int32)
To remove the bar item based on index.
Declaration
public override void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Overrides
RemoveHashInfoForItem(BarItem)
Declaration
protected void RemoveHashInfoForItem(BarItem barItem)
Parameters
| Type | Name | Description |
|---|---|---|
| BarItem | barItem |
StoreHashInfoForItem(BarItem)
Declaration
protected void StoreHashInfoForItem(BarItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| BarItem | item |
UpdateItemPositions(BarItem)
Declaration
protected virtual void UpdateItemPositions(BarItem updatedItem)
Parameters
| Type | Name | Description |
|---|---|---|
| BarItem | updatedItem |