PersonalizationAdministration.GetAllState 方法

定义

对于请求的个性化设置范围和其他指定参数,从基础数据存储区中返回所有个性化设置状态的信息集合。Returns a collection of all personalization state information from the underlying data store for the requested personalization scope and other specified parameters.

重载

GetAllState(PersonalizationScope)

对于请求的个性化设置范围,从基础数据存储区中返回所有个性化设置状态的信息集合。Returns a collection of all personalization state information from the underlying data store for the requested personalization scope.

GetAllState(PersonalizationScope, Int32, Int32, Int32)

基于指定参数,从基础数据存储区中返回所有个性化设置状态的信息子集。Returns a subset of all personalization state information from the underlying data store, based on the specified parameters.

GetAllState(PersonalizationScope)

对于请求的个性化设置范围,从基础数据存储区中返回所有个性化设置状态的信息集合。Returns a collection of all personalization state information from the underlying data store for the requested personalization scope.

public:
 static System::Web::UI::WebControls::WebParts::PersonalizationStateInfoCollection ^ GetAllState(System::Web::UI::WebControls::WebParts::PersonalizationScope scope);
public static System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection GetAllState (System.Web.UI.WebControls.WebParts.PersonalizationScope scope);
static member GetAllState : System.Web.UI.WebControls.WebParts.PersonalizationScope -> System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection
Public Shared Function GetAllState (scope As PersonalizationScope) As PersonalizationStateInfoCollection

参数

scope
PersonalizationScope

要检索的个性化设置信息的范围。The scope of the personalization information to be retrieved.

返回

PersonalizationStateInfoCollection

一个 PersonalizationStateInfoCollection,包含指定范围的状态信息。A PersonalizationStateInfoCollection containing state information for the specified scope.

例外

配置中定义的个性化设置提供程序的提供程序类型不正确。The provider for a personalization provider defined in configuration is not of the correct type.

尝试创建和初始化已配置的个性化设置提供程序的一个实例时出现配置异常。A configuration exception occurred while attempting to create and initialize an instance of one of the configured personalization providers.

- 或 --or-

找不到配置中定义的默认个性化设置提供程序。The default personalization provider defined in configuration could not be found.

scope 不是 PersonalizationScope 枚举的有效成员。scope is not a valid member of the PersonalizationScope enumeration.

注解

请注意,返回的集合仅包含 PersonalizationStateInfo 类型或类型的派生对象 SharedPersonalizationStateInfo UserPersonalizationStateInfoNote that the returned collection contains only PersonalizationStateInfo-derived objects of either type SharedPersonalizationStateInfo or type UserPersonalizationStateInfo. 使用默认的个性化设置提供程序 PersonalizationStateInfo 时,派生对象将按字母顺序返回,并按路径和用户名的组合进行升序排序。Using the default personalization provider, the PersonalizationStateInfo-derived objects are returned in alphabetical order, and sorted by a combination of path and user name in ascending order. 对象在集合中的顺序由提供程序确定。The order of the objects in the collection is determined by the provider.

另请参阅

适用于

GetAllState(PersonalizationScope, Int32, Int32, Int32)

基于指定参数,从基础数据存储区中返回所有个性化设置状态的信息子集。Returns a subset of all personalization state information from the underlying data store, based on the specified parameters.

public:
 static System::Web::UI::WebControls::WebParts::PersonalizationStateInfoCollection ^ GetAllState(System::Web::UI::WebControls::WebParts::PersonalizationScope scope, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public static System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection GetAllState (System.Web.UI.WebControls.WebParts.PersonalizationScope scope, int pageIndex, int pageSize, out int totalRecords);
static member GetAllState : System.Web.UI.WebControls.WebParts.PersonalizationScope * int * int * int -> System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection
Public Shared Function GetAllState (scope As PersonalizationScope, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As PersonalizationStateInfoCollection

参数

scope
PersonalizationScope

要检索的个性化设置信息的范围。The scope of the personalization information to be retrieved.

pageIndex
Int32

要返回的结果页的索引(从零开始)。The zero-based index of the page of results to return.

pageSize
Int32

要返回的记录数。The number of records to return.

totalRecords
Int32

可用记录的总数。The total number of records available.

返回

PersonalizationStateInfoCollection

一个 PersonalizationStateInfoCollection,包含指定范围和参数的状态信息。A PersonalizationStateInfoCollection containing state information for the specified scope and parameters.

例外

pageIndex 小于零。pageIndex is less than zero.

-or-

pageSize 小于或等于零。pageSize is less than or equal to zero.

- 或 --or-

配置中定义的个性化设置提供程序的提供程序类型不正确。The provider for a personalization provider defined in configuration is not of the correct type.

- 或 --or-

pageIndexpageSize 的组合超过了 MaxValueThe combination of pageIndex and pageSize exceeds MaxValue.

scope 不是 PersonalizationScope 枚举的有效成员。scope is not a valid member of the PersonalizationScope enumeration.

尝试创建和初始化已配置的个性化设置提供程序的一个实例时出现配置异常。A configuration exception occurred while attempting to create and initialize an instance of one of the configured personalization providers.

- 或 --or-

找不到配置中定义的默认个性化设置提供程序。The default personalization provider defined in configuration could not be found.

注解

返回的集合中的项主要基于范围,然后根据和参数将与该范围对应的记录进一步缩小为一个子集 pageIndex pageSizeThe items in the collection returned are based primarily on scope, and then the records corresponding to that scope are further reduced to a subset based on the pageIndex and pageSize parameters. 返回的集合仅包含 SharedPersonalizationStateInfo 实例或 UserPersonalizationStateInfo 实例。The collection returned contains either SharedPersonalizationStateInfo instances only, or UserPersonalizationStateInfo instances only.

返回的项受 pageIndex 和参数的约束 pageSize ,其中 pageIndex 控制要返回的记录以及要返回的 pageSize 记录数。The items returned are constrained by the pageIndex and pageSize parameters, where pageIndex controls which records to return and pageSize controls the number of records returned. 例如,如果 pageIndex 设置为0,并且 pageSize 设置为25,则返回的数据将是前25个条目。For example, if pageIndex was set to 0 and pageSize was set to 25, the data returned would be the first 25 entries. 如果 pageIndex 设置为1,并且 pageSize 设置为25,则返回的数据将为第26到50的条目。If pageIndex was set to 1 and pageSize was set to 25, the data returned would be entries 26 to 50. totalRecords参数返回可用记录的总数。The totalRecords parameter returns the total number of records that are available.

使用默认的个性化设置提供程序 PersonalizationStateInfo 时,派生对象将按字母顺序返回,并按路径和用户名的组合进行升序排序。Using the default personalization provider, the PersonalizationStateInfo-derived objects are returned in alphabetical order, and sorted by a combination of path and user name in ascending order. 对象在集合中的顺序由提供程序确定。The order of the objects in the collection is determined by the provider.

另请参阅

适用于