private void ProcessMarketChangeMessage(MarketChangeMessage message)
        {
            ChangeMessage <MarketChange> change = ChangeMessageFactory.ToChangeMessage(message);

            change = MarketSubscriptionHandler.ProcessChangeMessage(change);

            if (change != null)
            {
                ChangeHandler.OnMarketChange(change);
            }
        }
        private void ProcessOrderChangeMessage(OrderChangeMessage message)
        {
            ChangeMessage <OrderMarketChange> change = ChangeMessageFactory.ToChangeMessage(message);

            change = OrderSubscriptionHandler.ProcessChangeMessage(change);

            if (change != null)
            {
                ChangeHandler.OnOrderChange(change);
            }
        }
コード例 #3
0
        public static ChangeMessage <OrderMarketChange> ToChangeMessage(OrderChangeMessage message)
        {
            ChangeMessage <OrderMarketChange> change = new ChangeMessage <OrderMarketChange>()
            {
                Id          = (int)message.Id,
                Pt          = message.Pt,
                Clk         = message.Clk,
                InitialClk  = message.InitialClk,
                ConflateMs  = message.ConflateMs,
                HeartbeatMs = message.HeartbeatMs,
            };

            change.Items = message.Oc;

            switch (message.SegmentType)
            {
            case OrderChangeMessage.SegmentTypeEnum.SegStart:
                change.SegmentType = SegmentType.SEG_START;
                break;

            case OrderChangeMessage.SegmentTypeEnum.SegEnd:
                change.SegmentType = SegmentType.SEG_END;
                break;

            case OrderChangeMessage.SegmentTypeEnum.Seg:
                change.SegmentType = SegmentType.SEG;
                break;
            }
            switch (message.Ct)
            {
            case OrderChangeMessage.CtEnum.Heartbeat:
                change.ChangeType = ChangeType.HEARTBEAT;
                break;

            case OrderChangeMessage.CtEnum.ResubDelta:
                change.ChangeType = ChangeType.RESUB_DELTA;
                break;

            case OrderChangeMessage.CtEnum.SubImage:
                change.ChangeType = ChangeType.SUB_IMAGE;
                break;
            }
            return(change);
        }
 public void OnOrderChange(ChangeMessage <OrderMarketChange> change)
 {
     Console.WriteLine("<null change handler>.OnOrderChange: " + change);
 }