HttpApplicationStateBase 類別

定義

用做類別的基底類別,這些類別可在 ASP.NET 應用程式中,跨多個工作階段和要求共用資訊。Serves as the base class for classes that enable information to be shared across multiple sessions and requests within an ASP.NET application.

public ref class HttpApplicationStateBase abstract : System::Collections::Specialized::NameObjectCollectionBase, System::Collections::ICollection
public abstract class HttpApplicationStateBase : System.Collections.Specialized.NameObjectCollectionBase, System.Collections.ICollection
type HttpApplicationStateBase = class
    inherit NameObjectCollectionBase
    interface ICollection
    interface IEnumerable
Public MustInherit Class HttpApplicationStateBase
Inherits NameObjectCollectionBase
Implements ICollection
繼承
HttpApplicationStateBase
衍生
實作

備註

HttpApplicationStateBase類別是抽象類別,其包含與類別相同的成員 HttpApplicationStateThe HttpApplicationStateBase class is an abstract class that contains the same members as the HttpApplicationState class. HttpApplicationStateBase類別可讓您建立類似類別的衍生類別 HttpApplicationState ,但您可以自訂,也可以在 ASP.NET 管線之外進行自訂作業。The HttpApplicationStateBase class lets you create derived classes that are like the HttpApplicationState class, but that you can customize and that work outside the ASP.NET pipeline. 當您執行單元測試時,您通常會使用衍生類別來執行自訂行為的成員,以滿足您正在測試的案例。When you perform unit testing, you typically use a derived class to implement members with customized behavior that fulfills the scenario you are testing.

HttpApplicationStateWrapper 類別衍生自 HttpApplicationStateBase 類別。The HttpApplicationStateWrapper class derives from the HttpApplicationStateBase class. 類別可做為類別的包裝函式 HttpApplicationStateWrapper HttpApplicationStateThe HttpApplicationStateWrapper class serves as a wrapper for the HttpApplicationState class. 在執行時間,您通常會使用類別的實例 HttpApplicationStateWrapper 來呼叫物件的成員 HttpApplicationStateAt run time, you typically use an instance of the HttpApplicationStateWrapper class to call members of the HttpApplicationState object.

建構函式

HttpApplicationStateBase()

初始化這個類別,以供繼承的類別執行個體使用。Initializes the class for use by an inherited class instance. 這個建構函式只能由繼承的類別呼叫。This constructor can only be called by an inherited class.

屬性

AllKeys

在衍生類別中覆寫時,取得集合中物件的便捷鍵。When overridden in a derived class, gets the access keys for the objects in the collection.

Contents

在衍生類別中覆寫時,取得 HttpApplicationStateBase 物件的參考。When overridden in a derived class, gets a reference to the HttpApplicationStateBase object.

Count

在衍生類別中覆寫時,取得集合中的物件數。When overridden in a derived class, gets the number of objects in the collection.

IsReadOnly

取得或設定值,表示 NameObjectCollectionBase 執行個體是否為唯讀。Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

(繼承來源 NameObjectCollectionBase)
IsSynchronized

在衍生類別中覆寫時取得值,指出對集合的存取是否為安全執行緒。When overridden in a derived class, gets a value that indicates whether access to the collection is thread-safe.

Item[Int32]

在衍生類別中覆寫時,依索引取得狀態物件。When overridden in a derived class, gets a state object by index.

Item[String]

在衍生類別中覆寫時,依名稱取得狀態物件。When overridden in a derived class, gets a state object by name.

Keys

取得 NameObjectCollectionBase.KeysCollection 執行個體,其中包含 NameObjectCollectionBase 執行個體內的所有索引鍵。Gets a NameObjectCollectionBase.KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
StaticObjects

在衍生類別中覆寫時,取得 object 項目宣告的所有物件,其中範圍在 ASP.NET 應用程式中設定為 "Application"。When overridden in a derived class, gets all objects that are declared by an object element where the scope is set to "Application" in the ASP.NET application.

SyncRoot

在衍生類別中覆寫時,取得可用來同步存取集合的物件。When overridden in a derived class, gets an object that can be used to synchronize access to the collection.

方法

Add(String, Object)

在衍生類別中覆寫時,將新物件加入集合中。When overridden in a derived class, adds a new object to the collection.

BaseAdd(String, Object)

將具有指定索引鍵和值的項目加入 NameObjectCollectionBase 執行個體。Adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseClear()

將所有項目從 NameObjectCollectionBase 執行個體中移除。Removes all entries from the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseGet(Int32)

取得 NameObjectCollectionBase 執行個體指定索引處之項目的值。Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseGet(String)

NameObjectCollectionBase 執行個體取得具有指定索引鍵之第一個項目的值。Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseGetAllKeys()

傳回 String 陣列,其中包含 NameObjectCollectionBase 執行個體中的所有索引鍵。Returns a String array that contains all the keys in the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseGetAllValues()

傳回 Object 陣列,其中包含 NameObjectCollectionBase 執行個體中的所有值。Returns an Object array that contains all the values in the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseGetAllValues(Type)

傳回指定類型的陣列,其中包含 NameObjectCollectionBase 執行個體中的所有值。Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseGetKey(Int32)

取得 NameObjectCollectionBase 執行個體指定索引處之項目的索引鍵。Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseHasKeys()

取得值,表示 NameObjectCollectionBase 執行個體是否包含其索引鍵不是 null 的項目。Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not null.

(繼承來源 NameObjectCollectionBase)
BaseRemove(String)

將具有指定索引鍵的項目從 NameObjectCollectionBase 中移除。Removes the entries with the specified key from the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseRemoveAt(Int32)

移除 NameObjectCollectionBase 執行個體指定索引處的項目。Removes the entry at the specified index of the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseSet(Int32, Object)

設定 NameObjectCollectionBase 執行個體指定索引處之項目的值。Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
BaseSet(String, Object)

設定 NameObjectCollectionBase 執行個體中具有指定索引鍵之第一個項目的值 (如果有找到),否則將具有指定索引鍵和值的項目加入 NameObjectCollectionBase 執行個體。Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
Clear()

在衍生類別中覆寫時,移除集合中的所有物件。When overridden in a derived class, removes all objects from the collection.

CopyTo(Array, Int32)

在衍生類別中覆寫時,從陣列中指定的索引處開始,將集合的項目複製到陣列。When overridden in a derived class, copies the elements of the collection to an array, starting at the specified index in the array.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Get(Int32)

在衍生類別中覆寫時,依索引取得狀態物件。When overridden in a derived class, gets a state object by index.

Get(String)

在衍生類別中覆寫時,依名稱取得狀態物件。When overridden in a derived class, gets a state object by name.

GetEnumerator()

在衍生類別中覆寫時,傳回可用來逐一查看集合的列舉程式。When overridden in a derived class, returns an enumerator that can be used to iterate through the collection.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetKey(Int32)

在衍生類別中覆寫時,依索引取得狀態物件的名稱。When overridden in a derived class, gets the name of a state object by index.

GetObjectData(SerializationInfo, StreamingContext)

實作 ISerializable 介面,並傳回序列化 NameObjectCollectionBase 執行個體所需的資料。Implements the ISerializable interface and returns the data needed to serialize the NameObjectCollectionBase instance.

(繼承來源 NameObjectCollectionBase)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
Lock()

在衍生類別中覆寫時,鎖定集合中物件的存取權,以啟用同步存取。When overridden in a derived class, locks access to objects in the collection in order to enable synchronized access.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnDeserialization(Object)

實作 ISerializable 介面,並於還原序列化完成時引發還原序列化事件。Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

(繼承來源 NameObjectCollectionBase)
Remove(String)

在衍生類別中覆寫時,從此集合中移除具名物件。When overridden in a derived class, removes the named object from the collection.

RemoveAll()

在衍生類別中覆寫時,移除集合中的所有物件。When overridden in a derived class, removes all objects from the collection.

RemoveAt(Int32)

在衍生類別中被覆寫時,從集合中移除索引指定的狀態物件。When overridden in a derived class, removes a state object specified by index from the collection.

Set(String, Object)

在衍生類別中覆寫時,更新在集合中物件的值。When overridden in a derived class, updates the value of an object in the collection.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
UnLock()

在衍生類別中覆寫時,解除對集合中物件存取權的鎖定,以啟用同步存取。When overridden in a derived class, unlocks access to objects in the collection to enable synchronized access.

明確介面實作

ICollection.CopyTo(Array, Int32)

從目標陣列的指定索引開始,將整個 NameObjectCollectionBase 複製到相容的一維 ArrayCopies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(繼承來源 NameObjectCollectionBase)
ICollection.IsSynchronized

取得值,表示是否要同步處理 (執行緒安全) 對 NameObjectCollectionBase 物件的存取。Gets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe).

(繼承來源 NameObjectCollectionBase)
ICollection.SyncRoot

取得可用來同步處理對 NameObjectCollectionBase 物件之存取的物件。Gets an object that can be used to synchronize access to the NameObjectCollectionBase object.

(繼承來源 NameObjectCollectionBase)

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於