Example #1
0
        /// <summary>
        /// Returns the number of rows in the underlying data store that exist within the specified scope.
        /// </summary>
        /// <param name="scope">A PersonalizationScope with the personalization information to be queried. This value cannot be a null reference (Nothing in Visual Basic).</param>
        /// <param name="query">A PersonalizationStateQuery containing a query. This value can be a null reference (Nothing in Visual Basic).</param>
        /// <returns>The number of rows in the underlying data store that exist for the specified scope parameter.</returns>
        public override int GetCountOfState(System.Web.UI.WebControls.WebParts.PersonalizationScope scope, System.Web.UI.WebControls.WebParts.PersonalizationStateQuery query)
        {
            int totalRecords;
            PersonalizationStateInfoCollection col = FindState(scope, query, 0, int.MaxValue, out totalRecords);

            return(totalRecords);
        }
Example #2
0
 /// <summary>
 /// Gets a collection of PersonalizationStateInfo objects for the given PersonalizationStateQuery
 /// </summary>
 /// <param name="scope">A PersonalizationScope with the personalization information to be queried. This value cannot be a null reference (Nothing in Visual Basic).</param>
 /// <param name="query">A PersonalizationStateQuery containing a query. This value can be a null reference (Nothing in Visual Basic).</param>
 /// <param name="pageIndex">The location where the query starts.</param>
 /// <param name="pageSize">The number of records to return.</param>
 /// <param name="totalRecords">The total number of records available.</param>
 /// <returns>A PersonalizationStateInfoCollection containing zero or more PersonalizationStateInfo-derived objects.</returns>
 public override System.Web.UI.WebControls.WebParts.PersonalizationStateInfoCollection FindState(System.Web.UI.WebControls.WebParts.PersonalizationScope scope, System.Web.UI.WebControls.WebParts.PersonalizationStateQuery query, int pageIndex, int pageSize, out int totalRecords)
 {
     if (pageIndex < 0)
     {
         throw new ArgumentException("pageIndex cannot be less than zero", "pageIndex");
     }
     if (pageSize <= 0)
     {
         throw new ArgumentException("pageSize must be greater than zero", "pageSize");
     }
     if (scope == System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)
     {
         return(SharedPersonalizationDataSource.FindState(query, pageIndex, pageSize, out totalRecords));
     }
     else
     {
         return(UserPersonalizationDataSource.FindState(query, pageIndex, pageSize, out totalRecords));
     }
 }
Example #3
0
 /// <summary>
 /// Deletes personalization state from the underlying data store based on the specified parameters.
 /// </summary>
 /// <param name="scope">A PersonalizationScope of the personalization information to be reset. This value cannot be a null reference (Nothing in Visual Basic).</param>
 /// <param name="paths">The paths for personalization information to be deleted.</param>
 /// <param name="usernames">The user names for personalization information to be deleted.</param>
 /// <returns>The number of rows deleted.</returns>
 /// <remarks>This method is not implemented in AbleCommerce 7.</remarks>
 public override int ResetState(System.Web.UI.WebControls.WebParts.PersonalizationScope scope, string[] paths, string[] usernames)
 {
     throw new PersonalizationProviderException("The method or operation ResetState is not implemented.");
 }