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
实现

注解

实例是PersonalizationEntry对象的集合, 由个性化设置范围和对象值组成。 PersonalizationDictionaryA 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 类的新实例。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()

返回一个表示当前对象的 string。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.

适用于

另请参阅