DesignerActionItemCollection Klasse
Definition
Stellt eine Auflistung vonDesignerActionItem-Objekten dar.Represents a collection of DesignerActionItem objects.
public ref class DesignerActionItemCollection : System::Collections::CollectionBase
public class DesignerActionItemCollection : System.Collections.CollectionBase
type DesignerActionItemCollection = class
inherit CollectionBase
Public Class DesignerActionItemCollection
Inherits CollectionBase
- Vererbung
Beispiele
Im folgenden Codebeispiel wird veranschaulicht, wie Sie eine erstellen DesignerActionItemCollection und diese so auffüllen, dass Sie eine Smarttag-Liste bildet.The following code example demonstrates how to create a DesignerActionItemCollection and populate it to form a smart tag list. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die-Klasse bereitgestellt wird DesignerActionItem .This code example is part of a larger example provided for the DesignerActionItem class.
public override DesignerActionItemCollection GetSortedActionItems()
{
DesignerActionItemCollection items = new DesignerActionItemCollection();
//Define static section header entries.
items.Add(new DesignerActionHeaderItem("Appearance"));
items.Add(new DesignerActionHeaderItem("Information"));
//Boolean property for locking color selections.
items.Add(new DesignerActionPropertyItem("LockColors",
"Lock Colors", "Appearance",
"Locks the color properties."));
if (!LockColors)
{
items.Add(new DesignerActionPropertyItem("BackColor",
"Back Color", "Appearance",
"Selects the background color."));
items.Add(new DesignerActionPropertyItem("ForeColor",
"Fore Color", "Appearance",
"Selects the foreground color."));
//This next method item is also added to the context menu
// (as a designer verb).
items.Add(new DesignerActionMethodItem(this,
"InvertColors", "Invert Colors",
"Appearance",
"Inverts the fore and background colors.",
true));
}
items.Add(new DesignerActionPropertyItem("Text",
"Text String", "Appearance",
"Sets the display text."));
//Create entries for static Information section.
StringBuilder location = new StringBuilder("Location: ");
location.Append(colLabel.Location);
StringBuilder size = new StringBuilder("Size: ");
size.Append(colLabel.Size);
items.Add(new DesignerActionTextItem(location.ToString(),
"Information"));
items.Add(new DesignerActionTextItem(size.ToString(),
"Information"));
return items;
}
Public Overrides Function GetSortedActionItems() _
As DesignerActionItemCollection
Dim items As New DesignerActionItemCollection()
'Define static section header entries.
items.Add(New DesignerActionHeaderItem("Appearance"))
items.Add(New DesignerActionHeaderItem("Information"))
'Boolean property for locking color selections.
items.Add(New DesignerActionPropertyItem( _
"LockColors", _
"Lock Colors", _
"Appearance", _
"Locks the color properties."))
If Not LockColors Then
items.Add( _
New DesignerActionPropertyItem( _
"BackColor", _
"Back Color", _
"Appearance", _
"Selects the background color."))
items.Add( _
New DesignerActionPropertyItem( _
"ForeColor", _
"Fore Color", _
"Appearance", _
"Selects the foreground color."))
'This next method item is also added to the context menu
' (as a designer verb).
items.Add( _
New DesignerActionMethodItem( _
Me, _
"InvertColors", _
"Invert Colors", _
"Appearance", _
"Inverts the fore and background colors.", _
True))
End If
items.Add( _
New DesignerActionPropertyItem( _
"Text", _
"Text String", _
"Appearance", _
"Sets the display text."))
'Create entries for static Information section.
Dim location As New StringBuilder("Location: ")
location.Append(colLabel.Location)
Dim size As New StringBuilder("Size: ")
size.Append(colLabel.Size)
items.Add( _
New DesignerActionTextItem( _
location.ToString(), _
"Information"))
items.Add( _
New DesignerActionTextItem( _
size.ToString(), _
"Information"))
Return items
End Function
Konstruktoren
DesignerActionItemCollection() |
Initialisiert eine neue Instanz der DesignerActionItemCollection-Klasse.Initializes a new instance of the DesignerActionItemCollection class. |
Eigenschaften
Capacity |
Ruft die Anzahl der Elemente ab, die die CollectionBase enthalten kann, oder legt diese fest.Gets or sets the number of elements that the CollectionBase can contain. (Geerbt von CollectionBase) |
Count |
Ruft die Anzahl der in der CollectionBase-Instanz enthaltenen Elemente ab.Gets the number of elements contained in the CollectionBase instance. Diese Eigenschaft kann nicht überschrieben werden.This property cannot be overridden. (Geerbt von CollectionBase) |
InnerList |
Ruft eine ArrayList mit der Liste der Elemente in der CollectionBase-Instanz ab.Gets an ArrayList containing the list of elements in the CollectionBase instance. (Geerbt von CollectionBase) |
Item[Int32] |
Ruft das Element am angegebenen Index ab oder legt dieses fest.Gets or sets the element at the specified index. |
List |
Ruft eine IList mit der Liste der Elemente in der CollectionBase-Instanz ab.Gets an IList containing the list of elements in the CollectionBase instance. (Geerbt von CollectionBase) |
Methoden
Add(DesignerActionItem) |
Fügt der aktuellen Auflistung die angegebene DesignerActionItem hinzu.Adds the supplied DesignerActionItem to the current collection. |
Clear() |
Entfernt alle Objekte aus der CollectionBase-Instanz.Removes all objects from the CollectionBase instance. Diese Methode kann nicht überschrieben werden.This method cannot be overridden. (Geerbt von CollectionBase) |
Contains(DesignerActionItem) |
Ermittelt, ob DesignerActionItemCollection ein bestimmtes Element enthält.Determines whether the DesignerActionItemCollection contains a specific element. |
CopyTo(DesignerActionItem[], Int32) |
Kopiert die Elemente der aktuellen Auflistung in das angegebene Array, beginnend beim angegebenen Arrayindex.Copies the elements of the current collection into the supplied array, starting at the specified array index. |
Equals(Object) |
Bestimmt, ob das angegebene Objekt mit dem aktuellen Objekt identisch ist.Determines whether the specified object is equal to the current object. (Geerbt von Object) |
GetEnumerator() |
Gibt einen Enumerator zurück, der die CollectionBase durchläuft.Returns an enumerator that iterates through the CollectionBase instance. (Geerbt von CollectionBase) |
GetHashCode() |
Fungiert als Standardhashfunktion.Serves as the default hash function. (Geerbt von Object) |
GetType() |
Ruft den Type der aktuellen Instanz ab.Gets the Type of the current instance. (Geerbt von Object) |
IndexOf(DesignerActionItem) |
Bestimmt den Index eines angegebenen Elements in der Auflistung.Determines the index of a specific item in the collection. |
Insert(Int32, DesignerActionItem) |
Fügt am angegebenen Index ein Element in die DesignerActionItemCollection ein.Inserts an element into the DesignerActionItemCollection at the specified index. |
MemberwiseClone() |
Erstellt eine flache Kopie des aktuellen Object.Creates a shallow copy of the current Object. (Geerbt von Object) |
OnClear() |
Führt beim Löschen des Inhalts der CollectionBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.Performs additional custom processes when clearing the contents of the CollectionBase instance. (Geerbt von CollectionBase) |
OnClearComplete() |
Führt nach dem Löschen des Inhalts der CollectionBase-Instanz zusätzliche benutzerdefinierte Prozesse aus.Performs additional custom processes after clearing the contents of the CollectionBase instance. (Geerbt von CollectionBase) |
OnInsert(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse vor dem Einfügen eines neuen Elements in die CollectionBase-Instanz aus.Performs additional custom processes before inserting a new element into the CollectionBase instance. (Geerbt von CollectionBase) |
OnInsertComplete(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse nach dem Einfügen eines neuen Elements in die CollectionBase-Instanz aus.Performs additional custom processes after inserting a new element into the CollectionBase instance. (Geerbt von CollectionBase) |
OnRemove(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse beim Entfernen eines Elements aus der CollectionBase-Instanz aus.Performs additional custom processes when removing an element from the CollectionBase instance. (Geerbt von CollectionBase) |
OnRemoveComplete(Int32, Object) |
Führt zusätzliche benutzerdefinierte Prozesse nach dem Entfernen eines Elements aus der CollectionBase-Instanz aus.Performs additional custom processes after removing an element from the CollectionBase instance. (Geerbt von CollectionBase) |
OnSet(Int32, Object, Object) |
Führt zusätzliche benutzerdefinierte Prozesse vor dem Festlegen eines Werts in der CollectionBase-Instanz aus.Performs additional custom processes before setting a value in the CollectionBase instance. (Geerbt von CollectionBase) |
OnSetComplete(Int32, Object, Object) |
Führt zusätzliche benutzerdefinierte Prozesse nach dem Festlegen eines Werts in der CollectionBase-Instanz aus.Performs additional custom processes after setting a value in the CollectionBase instance. (Geerbt von CollectionBase) |
OnValidate(Object) |
Führt zusätzliche benutzerdefinierte Prozesse beim Validieren eines Werts aus.Performs additional custom processes when validating a value. (Geerbt von CollectionBase) |
Remove(DesignerActionItem) |
Entfernt das erste Vorkommen eines angegebenen Objekts aus der DesignerActionItemCollection.Removes the first occurrence of a specific object from the DesignerActionItemCollection. |
RemoveAt(Int32) |
Entfernt das Element am angegebenen Index aus der CollectionBase-Instanz.Removes the element at the specified index of the CollectionBase instance. Diese Methode kann nicht überschrieben werden.This method is not overridable. (Geerbt von CollectionBase) |
ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt.Returns a string that represents the current object. (Geerbt von Object) |
Explizite Schnittstellenimplementierungen
ICollection.CopyTo(Array, Int32) |
Kopiert die gesamte CollectionBase-Instanz in ein kompatibles eindimensionales Array, beginnend am angegebenen Index des Zielarrays.Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (Geerbt von CollectionBase) |
ICollection.IsSynchronized |
Ruft einen Wert ab, der angibt, ob der Zugriff auf die CollectionBase synchronisiert (threadsicher) ist.Gets a value indicating whether access to the CollectionBase is synchronized (thread safe). (Geerbt von CollectionBase) |
ICollection.SyncRoot |
Ruft ein Objekt ab, mit dem der Zugriff auf CollectionBase synchronisiert werden kann.Gets an object that can be used to synchronize access to the CollectionBase. (Geerbt von CollectionBase) |
IList.Add(Object) |
Fügt am Ende der CollectionBase ein Objekt hinzu.Adds an object to the end of the CollectionBase. (Geerbt von CollectionBase) |
IList.Contains(Object) |
Ermittelt, ob CollectionBase ein bestimmtes Element enthält.Determines whether the CollectionBase contains a specific element. (Geerbt von CollectionBase) |
IList.IndexOf(Object) |
Sucht nach dem angegebenen Object und gibt den nullbasierten Index des ersten Vorkommens innerhalb der gesamten CollectionBase zurück.Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase. (Geerbt von CollectionBase) |
IList.Insert(Int32, Object) |
Fügt am angegebenen Index ein Element in die CollectionBase ein.Inserts an element into the CollectionBase at the specified index. (Geerbt von CollectionBase) |
IList.IsFixedSize |
Ruft einen Wert ab, der angibt, ob das CollectionBase eine feste Größe aufweist.Gets a value indicating whether the CollectionBase has a fixed size. (Geerbt von CollectionBase) |
IList.IsReadOnly |
Ruft einen Wert ab, der angibt, ob das CollectionBase schreibgeschützt ist.Gets a value indicating whether the CollectionBase is read-only. (Geerbt von CollectionBase) |
IList.Item[Int32] |
Ruft das Element am angegebenen Index ab oder legt dieses fest.Gets or sets the element at the specified index. (Geerbt von CollectionBase) |
IList.Remove(Object) |
Entfernt das erste Vorkommen eines angegebenen Objekts aus der CollectionBase.Removes the first occurrence of a specific object from the CollectionBase. (Geerbt von CollectionBase) |
Erweiterungsmethoden
Cast<TResult>(IEnumerable) |
Wandelt die Elemente eines IEnumerable in den angegebenen Typ umCasts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Filtert die Elemente eines IEnumerable anhand eines angegebenen TypsFilters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Ermöglicht die Parallelisierung einer Abfrage.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Konvertiert einen IEnumerable in einen IQueryable.Converts an IEnumerable to an IQueryable. |