SubscriptionDefinitionSubscriptions Property Content Studio 5.7 SDK
Content Studio Web Content Management System

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

Gets the subscriptions of this subscription definition.

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

public SubscriptionCollection Subscriptions { get; }

Property Value

Type: SubscriptionCollection
A SubscriptionCollection object. This value can be null (Nothing in Visual Basic) if the subscription definition is not saved for the first time. When this is the case the Identifier property is null (Nothing in Visual Basic).
Remarks

This property returns a SubscriptionCollection object which supports paged reading and in order to access any data you must execute the Read method to get a page of data.

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