C# | Visual Basic | Visual C++ |
namespace Caplin.StreamLink.Subscription.Directory
Namespace Caplin.StreamLink.Subscription.Directory
namespace Caplin.StreamLink.Subscription.Directory
All Types | Interfaces |
Icon | Type | Description |
---|---|---|
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.
|
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.
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.