SubscriptionCollection Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

This class defines a collection data reader that reads subscriptions connected to a subscription definition. This data reader supports paging functionality.
Inheritance Hierarchy

SystemObject
  System.Collections.ObjectModelReadOnlyCollectionSubscription
    ContentStudio.Document.SubscriptionSubscriptionCollection

Namespace: ContentStudio.Document.Subscription
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public sealed class SubscriptionCollection : ReadOnlyCollection<Subscription>, 
	IPageable

The SubscriptionCollection type exposes the following members.

Properties

  NameDescription
Public propertyActivatedOnly
Gets or sets a value indicating whether to return only activated subscriptions. If this property is true and the subscription is not activated on the category no subscribers are returned.
Public propertyCount (Inherited from ReadOnlyCollectionSubscription.)
Public propertyEnabled
Gets a value indicating whether the subscription definition, whose subscriptions are being read, is enabled.
Public propertyItem (Inherited from ReadOnlyCollectionSubscription.)
Public propertyPageNumber
Gets a value that identifies which page of results found. 1 identifies the first page.
Public propertyPageSize
Gets a value that identifies the maximum number of objects that can be returned on a data page.
Public propertySortOrder
Gets or sets the sort order or the subscriptions.
Public propertyTotalItems
Gets the total number of items found.
Public propertyTotalPages
Gets the total number of data pages.
Top
Methods

  NameDescription
Public methodContains (Inherited from ReadOnlyCollectionSubscription.)
Public methodCopyTo (Inherited from ReadOnlyCollectionSubscription.)
Public methodStatic memberCreate
Creates SubscriptionCollection that can be used to read through the collection of subscribers on a specific SubscriptionDefinition.
Public methodEquals (Inherited from Object.)
Public methodGetEnumerator (Inherited from ReadOnlyCollectionSubscription.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodIndexOf (Inherited from ReadOnlyCollectionSubscription.)
Public methodRead
Reads the next data page in a paged data list.
Public methodReadPage
Reads data located on a specific data page.
Public methodToString (Inherited from Object.)
Top
Fields

  NameDescription
Public fieldStatic memberDefaultPageSize
Defines the default data page size used by this collection. This value is constant and is 10.
Top
Examples

The following small sample shows how to use the paged data reading collection of subscriptions to return all subscriptions of a specific type on the current category and write them to a regular Html-table. This code only works on a Content Studio document and exception handling is omitted.

SubscriptionDefinition supo = 
    new SubscriptionDefinition(CS_ConnectionId, 
                               CS_UserSession, 
                               CS_InsertedCategoryId, 
                               SubscriptionType.Newsletter);
//Get all subscribers
SubscriptionCollection subscriptions = supo.Subscriptions;
if (subscriptions != null)
{
    subscriptions.PageSize = 10;
    subscriptions.SortOrder = SubscriptionSorting.None;
    Response.Write("<table>\r\n");
    Response.Write("  <tr><th>Name</th><th>Address</th><th>Identifier</th></tr>\r\n");
    while (subscriptions.Read())
    {
        foreach(Subscription s in subscriptions)
        {
           Response.Write(" <tr>\r\n");
           Response.Write(String.Format("  <td>{0}</td><td>{1}</td><td>{2}</td>\r\n", 
                                        s.Name,
                                        s.Address.Address, 
                                        s.ID.ToString()));
           Response.Write(" </tr>\r\n");
        }
    } 
    Response.Write("</table>");
}
See Also

Reference