StreamLink.NET
CreateContainerSubscriptionParameters Method (windowStartIndex, windowSize)
StreamLink.NETCaplin.StreamLinkIParametersFactoryCreateContainerSubscriptionParameters(Int32, Int32)
Creates parameters for a container subscription, specifying the window range of the container.
Declaration Syntax
C#Visual BasicVisual C++
IContainerSubscriptionParameters CreateContainerSubscriptionParameters(
	int windowStartIndex,
	int windowSize
)
Function CreateContainerSubscriptionParameters ( _
	windowStartIndex As Integer, _
	windowSize As Integer _
) As IContainerSubscriptionParameters
IContainerSubscriptionParameters^ CreateContainerSubscriptionParameters(
	int windowStartIndex, 
	int windowSize
)
Parameters
windowStartIndex (Int32)
The start index of the window. This is the position in the container of the first element (RTTP subject) to be returned in the window. The first element in the container has index value zero.
windowSize (Int32)
The size of the window (number of elements).
Return Value
The container subscription parameters.
Examples
CopyC#
using System;
using System.Collections.Generic;
using System.Text;
using Caplin.StreamLink;
using Caplin.StreamLink.Authentication;
using Caplin.StreamLink.Subscription.Container;
using Caplin.StreamLink.Subscription.Record;
using StreamLinkExamples.Record;

namespace StreamLinkExamples.Container
{
    public class CreateContainerSubscriptionWithStartIndexAndCount
    {
        /// <summary>
        /// Create a subscription to a container, passing in container subscription parameters
        /// object which defines we are subscribing to the first 10 elements within the container
        /// </summary>
        public static void CreateContainerSubscriptionWithStartIndexAndCountExample()
        {
            StreamLink myStreamLink = new StreamLink();
            myStreamLink.CredentialsProvider = new PasswordCredentialsProvider("admin", "admin");

            IContainerSubscriptionListener subscriptionListener = new ExampleContainerSubscriptionListener();

            // Subscribe from the 1st element within the container.
            int containerStartIndex = 0;

            // Subscribe to 10 elements in the container.
            int containerElementCount = 10;

            IContainerSubscriptionParameters parameters =
                myStreamLink.StreamLinkProvider.ParametersFactory.CreateContainerSubscriptionParameters(
                    containerStartIndex, containerElementCount);

            IContainerSubscription subscription =
                myStreamLink.StreamLinkProvider.CreateContainerSubscription(subscriptionListener,
                                                                         "/DEMO/CONTAINER/DCONT",
                                                                         parameters);

            subscription.Subscribe();

            myStreamLink.StreamLinkProvider.Connect();
        }
    }
}

Assembly: Caplin.StreamLink (Module: Caplin.StreamLink) Version: 5.0.12.0 (5.0.12.0)