StyleCollection 類別

定義

表示 Style 物件的集合。

public ref class StyleCollection : System::Web::UI::StateManagedCollection
public class StyleCollection : System.Web.UI.StateManagedCollection
type StyleCollection = class
    inherit StateManagedCollection
Public Class StyleCollection
Inherits StateManagedCollection
繼承
StyleCollection

備註

StyleCollection 可以使用類別來儲存和管理 Style 控制項的物件。 控制項開發人員可以使用這個類別來包含一組套用至控制項之不同部分的樣式。

當加入物件時,集合會動態增加大小。 這個集合中的索引是以零為基底。 您 Count 可以使用屬性來判斷集合中有多少個物件。

此外,您 StyleCollection 也可以使用方法和屬性來提供下列功能:

  • Add要將單一樣式加入至集合的方法。

  • Insert要在集合內的特定索引處加入樣式的方法。

  • Remove要從集合中移除樣式的方法。

  • RemoveAt移除位於特定索引之樣式的方法。

  • Contains判斷特定樣式是否已存在於集合中的方法。

  • IndexOf用來在集合內取出樣式索引的方法。

  • Clear要從集合中移除所有樣式的方法。

屬性

Count

取得 StateManagedCollection 集合中所包含的項目數。

(繼承來源 StateManagedCollection)
Item[Int32]

取得 Style 物件中位於指定索引位置的 StyleCollection 物件。

方法

Add(Style)

將指定的 Style 物件附加到 StyleCollection 物件的結尾。

Clear()

將所有項目從 StateManagedCollection 集合中移除。

(繼承來源 StateManagedCollection)
Contains(Style)

判斷指定的樣式是否包含在集合中。

CopyTo(Array, Int32)

從特定的陣列索引開始,將 StateManagedCollection 集合的項目複製到陣列。

(繼承來源 StateManagedCollection)
CopyTo(Style[], Int32)

從目標陣列的指定索引處開始,將 StyleCollection 的項目複製到一維 Style 陣列中。

CreateKnownType(Int32)

根據 Style 方法傳回的單一項目集合,建立 GetKnownTypes() 類別的執行個體。

Equals(Object)

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

(繼承來源 Object)
GetEnumerator()

傳回逐一查看 StateManagedCollection 集合的列舉值。

(繼承來源 StateManagedCollection)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetKnownTypes()

取得 IStateManager 可包含之 StyleCollection 型別的陣列。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IndexOf(Style)

傳回指定的 Style 物件在集合中的索引。

Insert(Int32, Style)

將指定的 Style 物件插入至指定索引位置的 StyleCollection

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnClear()

在衍生類別中覆寫時,在 Clear() 方法移除集合的所有項目之前,執行額外工作。

(繼承來源 StateManagedCollection)
OnClearComplete()

在衍生類別中覆寫時,在 Clear() 方法完成移除集合的所有項目之後,執行額外工作。

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

在衍生類別中覆寫時,在 IList.Insert(Int32, Object)IList.Add(Object) 方法將項目加入集合之前,執行額外工作。

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

在衍生類別中覆寫時,在 IList.Insert(Int32, Object)IList.Add(Object) 方法將項目加入集合之後,執行額外工作。

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

在衍生類別中覆寫時,在 IList.Remove(Object)IList.RemoveAt(Int32) 方法從集合中移除指定的項目之前,執行額外工作。

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

在衍生類別中覆寫時,在 IList.Remove(Object)IList.RemoveAt(Int32) 方法從集合中移除指定的項目之後,執行額外工作。

(繼承來源 StateManagedCollection)
OnValidate(Object)

在衍生類別中覆寫時,驗證 StateManagedCollection 集合的項目。

(繼承來源 StateManagedCollection)
Remove(Style)

Style 物件移除指定的 StyleCollection 物件。

RemoveAt(Int32)

Style 物件的指定索引位置移除 StyleCollection 物件。

SetDirty()

強制整個 StateManagedCollection 集合序列化至檢視狀態。

(繼承來源 StateManagedCollection)
SetDirtyObject(Object)

指示集合中包含的輸入 Style 物件將其整個狀態記錄至檢視狀態,而非僅記錄變更資訊。

ToString()

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

(繼承來源 Object)

明確介面實作

ICollection.Count

取得 StateManagedCollection 集合中所包含的項目數。

(繼承來源 StateManagedCollection)
ICollection.IsSynchronized

取得值,表示 StateManagedCollection 集合是否為同步 (安全執行緒)。 在所有情況下,這個方法都會傳回 false

(繼承來源 StateManagedCollection)
ICollection.SyncRoot

取得物件,可用來同步處理對 StateManagedCollection 集合的存取。 在所有情況下,這個方法都會傳回 null

(繼承來源 StateManagedCollection)
IEnumerable.GetEnumerator()

傳回逐一查看 StateManagedCollection 集合的列舉值。

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

將項目加入 StateManagedCollection 集合。

(繼承來源 StateManagedCollection)
IList.Clear()

將所有項目從 StateManagedCollection 集合中移除。

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

判斷 StateManagedCollection 集合是否包含特定值。

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

判斷 StateManagedCollection 集合中指定之項目的索引。

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

將項目插入位於指定索引處的 StateManagedCollection 集合中。

(繼承來源 StateManagedCollection)
IList.IsFixedSize

取得值,表示 StateManagedCollection 集合是否具有固定大小。 在所有情況下,這個方法都會傳回 false

(繼承來源 StateManagedCollection)
IList.IsReadOnly

取得值,表示 StateManagedCollection 集合是否為唯讀。

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

取得指定索引處的 IStateManager 項目。

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

StateManagedCollection 集合中移除指定物件的第一個符合項目。

(繼承來源 StateManagedCollection)
IList.RemoveAt(Int32)

移除指定索引處的 IStateManager 項目。

(繼承來源 StateManagedCollection)
IStateManager.IsTrackingViewState

取得值,表示 StateManagedCollection 集合是否正在儲存變更至檢視狀態。

(繼承來源 StateManagedCollection)
IStateManager.LoadViewState(Object)

還原先前儲存之 StateManagedCollection 集合和內含 IStateManager 項目的檢視狀態。

(繼承來源 StateManagedCollection)
IStateManager.SaveViewState()

儲存自頁面回傳至伺服器以來 StateManagedCollection 集合和每個內含 IStateManager 物件的變更。

(繼承來源 StateManagedCollection)
IStateManager.TrackViewState()

使得 StateManagedCollection 集合和每個內含 IStateManager 物件追蹤其檢視狀態的變更,以便跨相同頁面要求保存這些變更。

(繼承來源 StateManagedCollection)

擴充方法

Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱