PersonalizationDictionary 類別

定義

封裝基本驗證規則,指出在 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
繼承
PersonalizationDictionary
實作

備註

PersonalizationDictionary實例是物件的集合 PersonalizationEntry ,其中包含個人化範圍和物件值。A PersonalizationDictionary instance is a collection of PersonalizationEntry objects, which consist of a personalization scope and an object value. 這些專案會在物件中被指派一個索引鍵 PersonalizationDictionaryThese 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 會以適當的方式儲存資訊;例如,當頁面在範圍內時,就會儲存共用資料 SharedThe .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 類別的新執行個體。Initializes a new instance of the PersonalizationDictionary class.

PersonalizationDictionary(Int32)

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

屬性

Count

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

IsFixedSize

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

IsReadOnly

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

IsSynchronized

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

Item[String]

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

Keys

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

SyncRoot

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

Values

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

方法

Add(String, PersonalizationEntry)

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

Clear()

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

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)

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

Equals(Object)

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

(繼承來源 Object)
GetEnumerator()

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

GetHashCode()

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

(繼承來源 Object)
GetType()

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

(繼承來源 Object)
MemberwiseClone()

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

(繼承來源 Object)
Remove(String)

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

ToString()

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

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

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

IDictionary.Add(Object, Object)

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

IDictionary.Contains(Object)

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

IDictionary.Item[Object]

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

IDictionary.Remove(Object)

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

IEnumerable.GetEnumerator()

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

擴充方法

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.

適用於

另請參閱