HttpApplicationStateWrapper 類別

定義

封裝 HTTP 內建物件,以在 ASP.NET 應用程式內的多個要求和工作階段之間共用資訊。Encapsulates the HTTP intrinsic object that enables information to be shared across multiple requests and sessions within an ASP.NET application.

public ref class HttpApplicationStateWrapper : System::Web::HttpApplicationStateBase
public class HttpApplicationStateWrapper : System.Web.HttpApplicationStateBase
type HttpApplicationStateWrapper = class
    inherit HttpApplicationStateBase
Public Class HttpApplicationStateWrapper
Inherits HttpApplicationStateBase
繼承

備註

HttpApplicationStateWrapper類別衍生自 HttpApplicationStateBase 類別,並作為類別的包裝函式 HttpApplicationStateThe HttpApplicationStateWrapper class derives from the HttpApplicationStateBase class and serves as a wrapper for the HttpApplicationState class. 這個類別會公開類別的功能, HttpApplicationState 同時也會公開 HttpApplicationStateBase 型別。This class exposes the functionality of the HttpApplicationState class while also exposing the HttpApplicationStateBase type. HttpApplicationStateBase類別可讓您 HttpApplicationState 在應用程式中使用自訂的實作為來取代類別的原始實作為,例如,當您在 ASP.NET 管線外部執行單元測試時。The HttpApplicationStateBase class enables you to replace the original implementation of the HttpApplicationState class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.

建構函式

HttpApplicationStateWrapper(HttpApplicationState)

初始化 HttpApplicationStateWrapper 類別的新執行個體。Initializes a new instance of the HttpApplicationStateWrapper class.

屬性

AllKeys

取得集合中之物件的索引鍵。Gets the keys for the objects in the collection.

Contents

取得 HttpApplicationStateBase 物件的參考。Gets a reference to the HttpApplicationStateBase object.

Count

取得集合中的物件數目。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

取得值,指出對集合的存取是否為安全執行緒。Gets a value that indicates whether access to the collection is thread-safe.

Item[Int32]

依索引取得狀態物件。Gets a state object by index.

Item[String]

依名稱取得狀態物件。Gets a state object by name.

Keys

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

StaticObjects

取得 object 項目宣告的所有物件,其中範圍在 ASP.NET 應用程式中設定為 "Application"。Gets all objects that are declared by an object element where the scope is set to "Application" in the ASP.NET application.

SyncRoot

取得物件,這個物件可以用來對集合進行同步存取。Gets an object that can be used to synchronize access to the collection.

方法

Add(String, Object)

將物件加入至集合。Adds an 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()

從集合中移除所有物件。Removes all objects from the collection.

CopyTo(Array, Int32)

從陣列中指定的索引處開始,將集合的項目複製到陣列。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)

依索引傳回狀態物件。Returns a state object by index.

Get(String)

依名稱傳回狀態物件。Returns a state object by name.

GetEnumerator()

傳回可用於逐一查看集合的列舉程式。Returns an enumerator that can be used to iterate through a collection.

GetHashCode()

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

(繼承來源 Object)
GetKey(Int32)

依索引傳回狀態物件的名稱。Returns the name of a state object by index.

GetObjectData(SerializationInfo, StreamingContext)

傳回序列化 HttpApplicationStateWrapper 物件所需的資料。Returns the data that is necessary to serialize the HttpApplicationStateWrapper object.

GetType()

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

(繼承來源 Object)
Lock()

鎖定集合中物件的存取權,以啟用同步存取。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)

還原序列化完成後,引發還原序列化事件。Raises the deserialization event when deserialization is finished.

Remove(String)

從該集合移除名稱指定的物件。Removes the object specified by name from the collection.

RemoveAll()

從集合中移除所有物件。Removes all objects from the collection.

RemoveAt(Int32)

從該集合移除索引指定的物件。Removes the object specified by index from the collection.

Set(String, Object)

更新集合中的物件值。Updates the value of an object in the collection.

ToString()

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

(繼承來源 Object)
UnLock()

解除鎖定集合中物件的存取權,以啟用同步存取。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.

適用於