PersonalizationDictionary PersonalizationDictionary PersonalizationDictionary PersonalizationDictionary Class

定義

封裝基本驗證規則,這些規則指出在 UserShared 範圍中,是否將自訂資料視為可個人化。Encapsulates basic validation rules that indicate whether a piece of custom data is considered personalizable in either User or Shared scope.

public ref class PersonalizationDictionary : System::Collections::IDictionary
public class PersonalizationDictionary : System.Collections.IDictionary
type PersonalizationDictionary = class
    interface IDictionary
    interface ICollection
    interface IEnumerable
Public Class PersonalizationDictionary
Implements IDictionary
繼承
PersonalizationDictionaryPersonalizationDictionaryPersonalizationDictionaryPersonalizationDictionary
實作

備註

APersonalizationDictionary例項為集合的PersonalizationEntry包含個人化範圍和值物件的物件。A PersonalizationDictionary instance is a collection of PersonalizationEntry objects, which consist of a personalization scope and an object value. 這些項目指派中的索引鍵PersonalizationDictionary物件。These entries are assigned a key in the PersonalizationDictionary object.

理想的作法是將所有的屬性新增至字典使用Save方法,不論頁面的範圍。A good practice is to add all properties to the dictionary using the Save method, regardless of the scope of the page. .NET Framework 會將資訊儲存在適當的方式;例如,共用的資料會儲存當頁面處於Shared範圍。The .NET Framework saves the information in the appropriate way; for example, shared data is saved when the page is in Shared scope. 不過,正在儲存 Web 組件值時,不會儲存共用的屬性,在頁面位於User範圍,而WebPart中的頁面中已加入控制項Shared範圍。However, shared properties are not saved when a Web Parts value is being saved, the page is in User scope, and the WebPart control was added with the page in Shared scope.

建構函式

PersonalizationDictionary() PersonalizationDictionary() PersonalizationDictionary() PersonalizationDictionary()

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

PersonalizationDictionary(Int32) PersonalizationDictionary(Int32) PersonalizationDictionary(Int32) PersonalizationDictionary(Int32)

使用提供的參數,初始化 PersonalizationDictionary 類別的新執行個體。Initializes a new instance of the PersonalizationDictionary class using the provided parameter.

屬性

Count Count Count Count

取得字典中的項目數。Gets the number of entries in the dictionary.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

取得個人化字典是否為固定大小。Gets whether the personalization dictionary is of a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得個人化字典是否是唯讀的。Gets whether the personalization dictionary is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

取得個人化字典是否是同步的。Gets whether the personalization dictionary is synchronized.

Item[String] Item[String] Item[String] Item[String]

取得或設定個人化字典中的項目。Gets or sets an entry in the personalization dictionary.

Keys Keys Keys Keys

取得 ICollection 物件的參考,該物件包含個人化字典的索引鍵。Gets a reference to an ICollection object containing the keys for the personalization dictionary.

SyncRoot SyncRoot SyncRoot SyncRoot

取得物件,該物件可用於同步對個人化字典的存取。Gets an object that can be used to synchronize access to the personalization dictionary.

Values Values Values Values

取得 ICollection 物件的參考,該物件包含個人化字典的值。Gets a reference to an ICollection object containing the values in the personalization dictionary.

方法

Add(String, PersonalizationEntry) Add(String, PersonalizationEntry) Add(String, PersonalizationEntry) Add(String, PersonalizationEntry)

將個人化項目加入個人化字典。Adds personalization entries to the personalization dictionary.

Clear() Clear() Clear() Clear()

移除目前 PersonalizationDictionary 物件的所有自訂狀態資訊。Removes all custom state information from the current PersonalizationDictionary object.

Contains(String) Contains(String) Contains(String) Contains(String)

傳回數值,表示個人化字典中是否包含具有相同索引鍵的自訂狀態資訊。Returns a value indicating whether a piece of custom state information with the same key is contained in the personalization dictionary.

CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32)

將個人化字典狀態項目做為 DictionaryEntry 執行個體,複製到指定陣列。Copies the personalization dictionary state entries as DictionaryEntry instances into the specified array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回列舉程式,該列舉程式可用於逐一查看個人化字典中的項目。Returns an enumerator that can be used to iterate through the entries in the personalization dictionary.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(String) Remove(String) Remove(String) Remove(String)

根據提供的索引鍵移除自訂狀態項目。Removes a custom state entry based on the provided key.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)

明確介面實作

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

實作 CopyTo(Array, Int32) 類別的 PersonalizationDictionary 方法。Implements the CopyTo(Array, Int32) method for the PersonalizationDictionary class.

IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object)

實作 Add(Object, Object) 類別的 PersonalizationDictionary 方法。Implements the Add(Object, Object) method for the PersonalizationDictionary class.

IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object)

實作 Contains(Object) 類別的 PersonalizationDictionary 方法。Implements the Contains(Object) method for the PersonalizationDictionary class.

IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object]

取得或設定 Item[Object] 類別的 PersonalizationDictionary 屬性值。Gets or sets the Item[Object] property value for the PersonalizationDictionary class.

IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object)

實作 Remove(Object) 類別的 PersonalizationDictionary 方法。Implements the Remove(Object) method for the PersonalizationDictionary class.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

實作 GetEnumerator() 類別的 PersonalizationDictionary 方法。Implements the GetEnumerator() method for the PersonalizationDictionary class.

擴充方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

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

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

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

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

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

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱