StreamLink for Silverlight
Caplin.StreamLink.Subscription.Story Namespace
StreamLink for SilverlightCaplin.StreamLink.Subscription.Story
Contains interfaces, classes, and enums related to the Story SubjectType. Defines the key interfaces concerning the subscription to a Story subject (IStorySubscription, IStorySubscriptionListener, the interface that provides access to the parameters used to request permission objects, (IStorySubscriptionParameters), and the interface for handling permission events (IStoryEvent).
Declaration Syntax
C#Visual BasicVisual C++
namespace Caplin.StreamLink.Subscription.Story
Namespace Caplin.StreamLink.Subscription.Story
namespace Caplin.StreamLink.Subscription.Story
Types
All TypesInterfaces
IconTypeDescription
IStoryEvent
Provides information about a change to story data in a Story (SubjectType Story).

IStorySubscription
Represents a subscription to a story subject

IStorySubscriptionListener
The IStorySubscriptionListener interface allows applications to receive events raised for a story subscription.

IStorySubscriptionParameters
Provides access to the parameters used for a subscription to a Story on the Liberator.

Remarks

Directory subscriptions are created through the IStreamLinkProvider interface using one of the CreateStorySubscription(IStorySubscriptionListener, String) methods. In all cases an IStorySubscriptionListener must be passed along with the name of the directory being subscribed to.

CopyC#
using System;

using Caplin.StreamLink;
using Caplin.StreamLink.Authentication;
using Caplin.StreamLink.Subscription.Story;
using Caplin.StreamLink.Configuration;
using Caplin.StreamLink.Logging;

namespace StreamLinkExamples.Story
{
    /// <summary>
    /// Examples of how to create an IStorySubscription using the
    /// IStreamLinkProvider interface.
    /// </summary>
    public class CreateStorySubscriptionBasic
    {


        /// <summary>
        /// Creates a simple permission subscription with no parameters.
        /// </summary>
        public static void CreateStorySubscriptionBasicExample()
        {
            // Set up StreamLink and login credentials
            IStreamLinkConfiguration config = SimpleConfiguration.CreateType2HttpConnection("localvm", 8080);

            IStreamLink myStreamLink = new StreamLink(config); 
            myStreamLink.CredentialsProvider =
                new PasswordCredentialsProvider("admin", "admin");
            myStreamLink.Logger = new ConsoleLogger();

            // Finally, connect to the Liberator
            myStreamLink.StreamLinkProvider.Connect();

            // Set up listener and created the subscription for /EXAMPLE/NEWSSTORY/FRONT/F2
            IStorySubscriptionListener listener =
                new ExampleStorySubscriptionListener();
            IStorySubscription subscription =
                myStreamLink.StreamLinkProvider.CreateStorySubscription(listener, "/EXAMPLE/NEWSSTORY/FRONT/F2");

            // Subscribe the subscription, this will be queued until we
            // login to the Liberator
            subscription.Subscribe();
        }
    }
}

The object implementing IStorySubscriptionListener will then be informed of all subscription status, error, and directory contents change events. (Also see ISubscriptionListener.)