Beispiel #1
0
        /// <summary>
        /// Sends a ChangedData message to a store.
        /// </summary>
        /// <param name="id">The channel identifier.</param>
        /// <param name="startIndex">The start index.</param>
        /// <param name="endIndex">The end index.</param>
        /// <param name="depthDatum">The depth datum.</param>
        /// <param name="uom">The unit of measure.</param>
        /// <param name="dataItems">The data items.</param>
        /// <returns>The message identifier.</returns>
        public virtual long ChangedData(long id, object startIndex, object endIndex, string depthDatum, string uom, IList <DataItem> dataItems)
        {
            var header = CreateMessageHeader(Protocols.ChannelDataLoad, MessageTypes.ChannelDataLoad.ChangedData);

            var message = new ChangedData
            {
                ChangedInterval = new IndexInterval
                {
                    StartIndex = new IndexValue {
                        Item = startIndex
                    },
                    EndIndex = new IndexValue {
                        Item = endIndex
                    },
                    DepthDatum = depthDatum,
                    Uom        = uom
                },
                Data = dataItems
            };

            return(Session.SendMessage(header, message));
        }
 /// <summary>
 /// Handles the ChangedData message from a customer.
 /// </summary>
 /// <param name="header">The message header.</param>
 /// <param name="message">The ChangedData message.</param>
 protected virtual void HandleChangedData(IMessageHeader header, ChangedData message)
 {
     Notify(OnChangedData, header, message);
 }