StreamLink.NET
Caplin.StreamLink.Subscription.Directory Namespace
StreamLink.NETCaplin.StreamLink.Subscription.Directory
Contains interfaces, classes and enums related to directories. Defines the key interfaces IDirectorySubscription and IDirectorySubscriptionListener in addition to the IDirectoryEvent, IDirectoryElement, IDirectorySubscriptionParameters interfaces.
Declaration Syntax
C#Visual BasicVisual C++
namespace Caplin.StreamLink.Subscription.Directory
Namespace Caplin.StreamLink.Subscription.Directory
namespace Caplin.StreamLink.Subscription.Directory
Types
All TypesInterfaces
IconTypeDescription
IDirectoryElement
Represents an element found within a directory on the Liberator. A number of IDirectoryElement will be part of updates related to IDirectorySubscription

IDirectoryEvent

The interface implemented by an event object relating to a directory within the Liberator.

The interface provides access to information about the directory such as the contained elements and subsequent content changes via the AddedElements and RemovedElements properties.


IDirectorySubscription
Represents a subscription to a directory on the Liberator.

IDirectorySubscriptionListener
Callback interface to be called when information regarding a directory updates.

IDirectorySubscriptionParameters
Subscription parameters for directories.

Remarks

Directory subscriptions are created through the IStreamLinkProvider interface using one of the CreateDirectorySubscription(IDirectorySubscriptionListener, String) methods. In all cases an IDirectorySubscriptionListener 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.Directory;

namespace StreamLinkExamples.Directory
{
    /// <summary>
    /// Examples of how to create an IDirectorySubscription using the
    /// IStreamLinkProvider interface.
    /// </summary>
    public class CreateDirectorySubscriptionBasic
    {
        /// <summary>
        /// Creates a simple directory subscription with no parameters.
        /// </summary>
        public static void CreateDirectorySubscriptionBasicExample()
        {
            // Set up StreamLink and login credentials
            StreamLink myStreamLink = new StreamLink();
            myStreamLink.CredentialsProvider =
                new PasswordCredentialsProvider("admin", "admin");

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

            // Set up listener and created the subscription for /DEMO
            IDirectorySubscriptionListener listener =
                new ExampleDirectorySubscriptionListener();
            IDirectorySubscription subscription =
                myStreamLink.StreamLinkProvider.CreateDirectorySubscription(listener, "/DEMO");

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

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

See Also