DesignerVerbCollection 類別

定義

表示 DesignerVerb 物件的集合。

public ref class DesignerVerbCollection : System::Collections::CollectionBase
public class DesignerVerbCollection : System.Collections.CollectionBase
[System.Runtime.InteropServices.ComVisible(true)]
public class DesignerVerbCollection : System.Collections.CollectionBase
type DesignerVerbCollection = class
    inherit CollectionBase
[<System.Runtime.InteropServices.ComVisible(true)>]
type DesignerVerbCollection = class
    inherit CollectionBase
Public Class DesignerVerbCollection
Inherits CollectionBase
繼承
DesignerVerbCollection
衍生
屬性

範例

下列程式代碼範例示範如何使用 DesignerVerbCollection 類別。 此範例會建立 類別的新實例,並使用數種方法將 語句加入集合、傳回其索引,以及在特定索引點加入或移除屬性。

// Creates an empty DesignerVerbCollection.
DesignerVerbCollection^ collection = gcnew DesignerVerbCollection;

// Adds a DesignerVerb to the collection.
collection->Add( gcnew DesignerVerb( "Example designer verb",gcnew EventHandler( this, &Class1::ExampleEvent ) ) );

// Adds an array of DesignerVerb objects to the collection.
array<DesignerVerb^>^ verbs = {
   gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ),
   gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) )};
collection->AddRange( verbs );

// Adds a collection of DesignerVerb objects to the collection.
DesignerVerbCollection^ verbsCollection = gcnew DesignerVerbCollection;
verbsCollection->Add( gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
verbsCollection->Add( gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );
collection->AddRange( verbsCollection );

// Tests for the presence of a DesignerVerb in the collection,
// and retrieves its index if it is found.
DesignerVerb^ testVerb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
int itemIndex = -1;
if ( collection->Contains( testVerb ) )
         itemIndex = collection->IndexOf( testVerb );

// Copies the contents of the collection, beginning at index 0,
// to the specified DesignerVerb array.
// 'verbs' is a DesignerVerb array.
collection->CopyTo( verbs, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection->Count;

// Inserts a DesignerVerb at index 0 of the collection.
collection->Insert( 0, gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) ) );

// Removes the specified DesignerVerb from the collection.
DesignerVerb^ verb = gcnew DesignerVerb( "Example designer verb", gcnew EventHandler( this, &Class1::ExampleEvent ) );
collection->Remove( verb );

// Removes the DesignerVerb at index 0.
collection->RemoveAt( 0 );
// Creates an empty DesignerVerbCollection.
DesignerVerbCollection collection = new DesignerVerbCollection();

// Adds a DesignerVerb to the collection.
collection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );

// Adds an array of DesignerVerb objects to the collection.
DesignerVerb[] verbs = { new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)), new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) };
collection.AddRange( verbs );

// Adds a collection of DesignerVerb objects to the collection.
DesignerVerbCollection verbsCollection = new DesignerVerbCollection();
verbsCollection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
verbsCollection.Add( new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );
collection.AddRange( verbsCollection );

// Tests for the presence of a DesignerVerb in the collection, 
// and retrieves its index if it is found.
DesignerVerb testVerb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
int itemIndex = -1;
if( collection.Contains( testVerb ) )
    itemIndex = collection.IndexOf( testVerb );

// Copies the contents of the collection, beginning at index 0, 
// to the specified DesignerVerb array.
// 'verbs' is a DesignerVerb array.
collection.CopyTo( verbs, 0 );

// Retrieves the count of the items in the collection.
int collectionCount = collection.Count;

// Inserts a DesignerVerb at index 0 of the collection.
collection.Insert( 0, new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent)) );

// Removes the specified DesignerVerb from the collection.
DesignerVerb verb = new DesignerVerb("Example designer verb", new EventHandler(this.ExampleEvent));
collection.Remove( verb );

// Removes the DesignerVerb at index 0.
collection.RemoveAt(0);
' Creates an empty DesignerVerbCollection.
Dim collection As New DesignerVerbCollection()

' Adds a DesignerVerb to the collection.
collection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))

' Adds an array of DesignerVerb objects to the collection.
Dim verbs As DesignerVerb() = {New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)), New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))}
collection.AddRange(verbs)

' Adds a collection of DesignerVerb objects to the collection.
Dim verbsCollection As New DesignerVerbCollection()
verbsCollection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))
verbsCollection.Add(New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))
collection.AddRange(verbsCollection)

' Tests for the presence of a DesignerVerb in the collection, 
' and retrieves its index if it is found.
Dim testVerb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))
Dim itemIndex As Integer = -1
If collection.Contains(testVerb) Then
    itemIndex = collection.IndexOf(testVerb)
End If

' Copies the contents of the collection, beginning at index 0, 
' to the specified DesignerVerb array.
' 'verbs' is a DesignerVerb array.
collection.CopyTo(verbs, 0)

' Retrieves the count of the items in the collection.
Dim collectionCount As Integer = collection.Count

' Inserts a DesignerVerb at index 0 of the collection.
collection.Insert(0, New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent)))

' Removes the specified DesignerVerb from the collection.
Dim verb As New DesignerVerb("Example designer verb", New EventHandler(AddressOf Me.ExampleEvent))
collection.Remove(verb)

' Removes the DesignerVerb at index 0.
collection.RemoveAt(0)

備註

這個類別提供可包含 DesignerVerb 物件的集合。

建構函式

DesignerVerbCollection()

初始化 DesignerVerbCollection 類別的新執行個體。

DesignerVerbCollection(DesignerVerb[])

使用 DesignerVerbCollection 物件指定的陣列,來初始化 DesignerVerb 類別的新執行個體。

屬性

Capacity

取得或設定 CollectionBase 可包含的項目數目。

(繼承來源 CollectionBase)
Count

取得 CollectionBase 執行個體中包含的元素數目。 這個屬性無法覆寫。

(繼承來源 CollectionBase)
InnerList

取得包含 ArrayList 執行個體中之元素清單的 CollectionBase

(繼承來源 CollectionBase)
Item[Int32]

取得或設定在指定索引處的 DesignerVerb

List

取得包含 IList 執行個體中之元素清單的 CollectionBase

(繼承來源 CollectionBase)

方法

Add(DesignerVerb)

將指定的 DesignerVerb 加入至集合。

AddRange(DesignerVerb[])

加入指定的設計工具動詞命令集至集合。

AddRange(DesignerVerbCollection)

加入指定的設計工具動詞命令集合至集合。

Clear()

CollectionBase 執行個體移除所有的物件。 無法覆寫這個方法。

(繼承來源 CollectionBase)
Contains(DesignerVerb)

取得值,表示指定的 DesignerVerb 是否存在於集合中。

CopyTo(DesignerVerb[], Int32)

複製集合成員至指定的 DesignerVerb 陣列,起始於指定的目的索引。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetEnumerator()

傳回可逐一查看 CollectionBase 執行個體的列舉值。

(繼承來源 CollectionBase)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IndexOf(DesignerVerb)

取得指定 DesignerVerb 的索引。

Insert(Int32, DesignerVerb)

插入指定的 DesignerVerb 於指定的索引處。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnClear()

引發 Clear 事件。

OnClear()

在清除 CollectionBase 執行個體的內容之後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnClearComplete()

在清除 CollectionBase 執行個體的內容後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnInsert(Int32, Object)

引發 Insert 事件。

OnInsert(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體前,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnInsertComplete(Int32, Object)

在將新的元素插入至 CollectionBase 執行個體後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnRemove(Int32, Object)

引發 Remove 事件。

OnRemove(Int32, Object)

當從 CollectionBase 執行個體移除元素時,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnRemoveComplete(Int32, Object)

在從 CollectionBase 執行個體移除元素後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnSet(Int32, Object, Object)

引發 Set 事件。

OnSet(Int32, Object, Object)

CollectionBase 執行個體中設定數值前,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnSetComplete(Int32, Object, Object)

CollectionBase 執行個體中設定數值後,執行額外的自訂處理序。

(繼承來源 CollectionBase)
OnValidate(Object)

引發 Validate 事件。

Remove(DesignerVerb)

從集合移除指定的 DesignerVerb

RemoveAt(Int32)

移除 CollectionBase 執行個體之指定索引的元素。 這個方法不可覆寫。

(繼承來源 CollectionBase)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

從目標陣列的指定索引開始,將整個 CollectionBase 複製到相容的一維 Array

(繼承來源 CollectionBase)
ICollection.IsSynchronized

取得值,這個值表示對 CollectionBase 的存取是否同步 (安全執行緒)。

(繼承來源 CollectionBase)
ICollection.SyncRoot

取得可用以同步存取 CollectionBase 的物件。

(繼承來源 CollectionBase)
IList.Add(Object)

將物件加入至 CollectionBase 的末端。

(繼承來源 CollectionBase)
IList.Contains(Object)

判斷 CollectionBase 是否包含特定項目。

(繼承來源 CollectionBase)
IList.IndexOf(Object)

搜尋指定的 Object,並傳回在整個 CollectionBase 中第一個符合項目之以零為起始的索引。

(繼承來源 CollectionBase)
IList.Insert(Int32, Object)

將項目插入至 CollectionBase 中指定的索引位置。

(繼承來源 CollectionBase)
IList.IsFixedSize

取得值,指出 CollectionBase 是否有固定的大小。

(繼承來源 CollectionBase)
IList.IsReadOnly

取得值,指出 CollectionBase 是否唯讀。

(繼承來源 CollectionBase)
IList.Item[Int32]

在指定的索引位置上取得或設定項目。

(繼承來源 CollectionBase)
IList.Remove(Object)

CollectionBase 移除特定物件之第一個符合的元素。

(繼承來源 CollectionBase)

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於