PersonalizationProvider.ResetState(PersonalizationScope, String[], String[]) 方法
定义
在派生类中重写时,根据指定的参数从基础数据存储区删除个性化设置状态。When overridden in a derived class, deletes personalization state from the underlying data store based on the specified parameters.
public:
abstract int ResetState(System::Web::UI::WebControls::WebParts::PersonalizationScope scope, cli::array <System::String ^> ^ paths, cli::array <System::String ^> ^ usernames);
public abstract int ResetState (System.Web.UI.WebControls.WebParts.PersonalizationScope scope, string[] paths, string[] usernames);
abstract member ResetState : System.Web.UI.WebControls.WebParts.PersonalizationScope * string[] * string[] -> int
Public MustOverride Function ResetState (scope As PersonalizationScope, paths As String(), usernames As String()) As Integer
参数
- scope
- PersonalizationScope
要重置的个性化设置信息的 PersonalizationScope。A PersonalizationScope of the personalization information to be reset. 此值不能为 null。This value cannot be null.
- paths
- String[]
要删除的个性化设置信息的路径。The paths for personalization information to be deleted.
- usernames
- String[]
要删除的个性化设置信息的用户名。The user names for personalization information to be deleted.
返回
删除的行数。The number of rows deleted.
注解
此方法是用于删除个性化设置数据的管理方法的抽象定义。This method is the abstract definition of an administrative method for deleting personalization data. 派生实现应遵循如下所述的逻辑。Derived implementations should follow the logic described below.
此方法不支持通配符搜索。No wildcard character searches are supported by this method. 如果个性化设置提供程序公开了事务感知数据存储区中的数据,则此方法应以单个原子事务的形式执行其操作。If the personalization provider exposes data from a transaction-aware data store, this method should perform its operations as a single atomic transaction.
仅允许以下参数组合:Only the following combinations of parameters are allowed:
scope设置参数,并将所有其他参数设置为null。Thescopeparameter is set, and all other parameters are set tonull. 此组合将删除与所指示的个性化设置范围关联的所有 Web 部件的个性化设置数据scope。This combination deletes all Web Parts personalization data associated with the personalization scope indicated byscope.scope设置了参数,且paths参数至少包含一个值。Thescopeparameter is set, and thepathsparameter contains at least one value. 此组合将删除所指示的个性化设置范围中的指定路径的所有 Web 部件的个性化设置数据scope。This combination deletes all Web Parts personalization data for the specified path or paths in the personalization scope indicated byscope.scope参数设置为 User ,paths参数设置为,仅包含一个值,并且usernames参数至少包含一个值。Thescopeparameter is set to User, thepathsparameter is set and contains only one value, and theusernamesparameter contains at least one value. 此组合将删除与中包含的用户或用户关联的给定路径的所有用户个性化 Web 部件数据usernames。This combination deletes all user personalization Web Parts data for the given path that is associated with the user or users contained inusernames.scope参数设置为 User ,paths参数设置为null,并且usernames参数至少包含一个值。Thescopeparameter is set to User, thepathsparameter is set tonull, and theusernamesparameter contains at least one value. 此组合将删除与中包含的用户或用户关联的所有路径中每个用户的个性化 Web 部件数据usernames。This combination deletes all per-user personalization Web Parts data, across all paths, associated with the user or users contained inusernames.
参数值的任何其他组合均无效,并将引发 ArgumentException 异常。Any other combination of parameter values is invalid and will throw an ArgumentException exception. 具体而言,不允许使用以下两种组合:Specifically, the following two combinations are not allowed:
usernames当设置为时,不能提供参数scopeShared 。Theusernamesparameter cannot be provided whenscopeis set to Shared.参数不
paths能包含多个项usernamesnull。Thepathsparameter cannot contain more than one entry when theusernamesparameter is notnull.
paths usernames 各个数组中包含的任何和参数值都必须满足下列验证规则。Any paths and usernames parameter values contained within the respective arrays must meet the following validation rules. 如果任何参数数组成员的任何验证规则都失败,则 ArgumentException 会引发异常。If any validation rules fail for any member of the parameter arrays, an ArgumentException exception is thrown. 验证规则如下:The validation rules are:
null不允许使用值。nullvalues are not allowed.不允许使用空字符串 ( "" ) 。An empty string ("") is not allowed. 在执行空字符串检查之前,应剪裁参数。Parameters should be trimmed prior to performing an empty string check.
usernames参数不能包含逗号 (,) 。Theusernamesparameter cannot contain commas (,).paths对于 SQL 数据库,参数的长度不能超过256个字符。The length of thepathsparameter cannot be greater than 256 characters for a SQL database.usernames对于 SQL 数据库,参数的长度不能超过256个字符。The length of theusernamesparameter cannot be greater than 256 characters for a SQL database.