Exemplo n.º 1
0
        public IDxSubscription CreateIncOrderSnapshotSubscription(IDxIncOrderSnapshotListener listener)
        {
            if (handle == IntPtr.Zero)
            {
                throw new NativeDxException("not connected");
            }

            IDxSubscription result = new NativeSnapshotSubscription(this, listener);

            subscriptions.Add(result);
            return(result);
        }
        /// <summary>
        /// Creates the new native order subscription on snapshot with incremental updates.
        /// </summary>
        /// <remarks>
        ///     Don't call this constructor inside any listeners and callbacks of NativeSubscription, NativeConnection,
        /// NativeRegionalBook, NativeSnapshotSubscription classes
        /// </remarks>
        /// <param name="connection">Native connection pointer.</param>
        /// <param name="listener">Snapshot or update events listener.</param>
        /// <exception cref="ArgumentNullException">Listener is invalid.</exception>
        public NativeSnapshotSubscription(NativeConnection connection, IDxIncOrderSnapshotListener listener)
        {
            if (listener == null)
            {
                throw new ArgumentNullException(nameof(listener));
            }

            connectionPtr   = connection.Handle;
            this.listener   = listener;
            this.time       = 0;
            this.connection = connection;
        }