DesignerActionItemCollection Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Representerar en samling DesignerActionItem objekt.
public ref class DesignerActionItemCollection : System::Collections::CollectionBase
public class DesignerActionItemCollection : System.Collections.CollectionBase
type DesignerActionItemCollection = class
inherit CollectionBase
Public Class DesignerActionItemCollection
Inherits CollectionBase
- Arv
Exempel
I följande kodexempel visas hur du skapar en DesignerActionItemCollection och fyller i den för att skapa en lista med smarta taggar. Det här kodexemplet är en del av ett större exempel för DesignerActionItem klassen.
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
Konstruktorer
| Name | Description |
|---|---|
| DesignerActionItemCollection() |
Initierar en ny instans av DesignerActionItemCollection klassen. |
Egenskaper
| Name | Description |
|---|---|
| Capacity |
Hämtar eller anger antalet element som CollectionBase kan innehålla. (Ärvd från CollectionBase) |
| Count |
Hämtar antalet element som finns i instansen CollectionBase . Den här egenskapen kan inte åsidosättas. (Ärvd från CollectionBase) |
| InnerList |
Hämtar en ArrayList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
| Item[Int32] |
Hämtar eller anger elementet vid det angivna indexet. |
| List |
Hämtar en IList lista med element i instansen CollectionBase . (Ärvd från CollectionBase) |
Metoder
| Name | Description |
|---|---|
| Add(DesignerActionItem) |
Lägger till den angivna DesignerActionItem i den aktuella samlingen. |
| Clear() |
Tar bort alla objekt från instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| Contains(DesignerActionItem) |
Avgör om innehåller DesignerActionItemCollection ett specifikt element. |
| CopyTo(DesignerActionItem[], Int32) |
Kopierar elementen i den aktuella samlingen till den angivna matrisen med början vid det angivna matrisindexet. |
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetEnumerator() |
Returnerar en uppräkning som itererar genom instansen CollectionBase . (Ärvd från CollectionBase) |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| IndexOf(DesignerActionItem) |
Avgör indexet för ett specifikt objekt i samlingen. |
| Insert(Int32, DesignerActionItem) |
Infogar ett element i DesignerActionItemCollection det angivna indexet. |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| OnClear() |
Utför ytterligare anpassade processer när du rensar innehållet i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnClearComplete() |
Utför ytterligare anpassade processer när innehållet i instansen har rensats CollectionBase . (Ärvd från CollectionBase) |
| OnInsert(Int32, Object) |
Utför ytterligare anpassade processer innan du infogar ett nytt element i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnInsertComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har infogat ett nytt element i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnRemove(Int32, Object) |
Utför ytterligare anpassade processer när du tar bort ett element från instansen CollectionBase . (Ärvd från CollectionBase) |
| OnRemoveComplete(Int32, Object) |
Utför ytterligare anpassade processer när du har tagit bort ett element från instansen CollectionBase . (Ärvd från CollectionBase) |
| OnSet(Int32, Object, Object) |
Utför ytterligare anpassade processer innan du anger ett värde i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnSetComplete(Int32, Object, Object) |
Utför ytterligare anpassade processer när du har angett ett värde i instansen CollectionBase . (Ärvd från CollectionBase) |
| OnValidate(Object) |
Utför ytterligare anpassade processer när du verifierar ett värde. (Ärvd från CollectionBase) |
| Remove(DesignerActionItem) |
Tar bort den första förekomsten av ett specifikt objekt från DesignerActionItemCollection. |
| RemoveAt(Int32) |
Tar bort elementet vid det angivna indexet för instansen CollectionBase . Den här metoden kan inte åsidosättas. (Ärvd från CollectionBase) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |
Explicita gränssnittsimplementeringar
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Kopierar hela CollectionBase till en kompatibel endimensionell Array, med början vid det angivna indexet för målmatrisen. (Ärvd från CollectionBase) |
| ICollection.IsSynchronized |
Hämtar ett värde som anger om åtkomsten CollectionBase till är synkroniserad (trådsäker). (Ärvd från CollectionBase) |
| ICollection.SyncRoot |
Hämtar ett objekt som kan användas för att synkronisera åtkomsten CollectionBasetill . (Ärvd från CollectionBase) |
| IList.Add(Object) |
Lägger till ett objekt i slutet av CollectionBase. (Ärvd från CollectionBase) |
| IList.Contains(Object) |
Avgör om innehåller CollectionBase ett specifikt element. (Ärvd från CollectionBase) |
| IList.IndexOf(Object) |
Söker efter den angivna Object och returnerar det nollbaserade indexet för den första förekomsten i hela CollectionBase. (Ärvd från CollectionBase) |
| IList.Insert(Int32, Object) |
Infogar ett element i CollectionBase det angivna indexet. (Ärvd från CollectionBase) |
| IList.IsFixedSize |
Hämtar ett värde som anger om har CollectionBase en fast storlek. (Ärvd från CollectionBase) |
| IList.IsReadOnly |
Hämtar ett värde som anger om är CollectionBase skrivskyddat. (Ärvd från CollectionBase) |
| IList.Item[Int32] |
Hämtar eller anger elementet vid det angivna indexet. (Ärvd från CollectionBase) |
| IList.Remove(Object) |
Tar bort den första förekomsten av ett specifikt objekt från CollectionBase. (Ärvd från CollectionBase) |
Tilläggsmetoder
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Möjliggör parallellisering av en fråga. |
| AsQueryable(IEnumerable) |
Konverterar en IEnumerable till en IQueryable. |
| Cast<TResult>(IEnumerable) |
Omvandlar elementen i en IEnumerable till den angivna typen. |
| OfType<TResult>(IEnumerable) |
Filtrerar elementen i en IEnumerable baserat på en angiven typ. |