Esempio n. 1
0
 protected virtual void OnTextLineEvent(TextLineEventArgs e)
 {
     if (TextLineEvent != null)
     {
         TextLineEvent(this, e);
     }
 }
Esempio n. 2
0
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith("S,STATS,"))
            {
                _status.Update(e.textLine);
                return;
            }
            if (e.textLine.StartsWith("S,CLIENTSTATS,"))
            {
                OnClientStatsEvent(new ClientStatsEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("S,REGISTER CLIENT APP COMPLETED,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,REMOVE CLIENT APP COMPLETED,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,CURRENT LOGINID,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,CURRENT PASSWORD,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,LOGIN INFO "))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,AUTOCONNECT "))
            {
                // placeholder for event
                return;
            }

            throw new Exception("(Admin) NOT HANDLED:" + e.textLine);
        }
Esempio n. 3
0
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith("!ENDMSG!"))
            {
                var lut = _peekQue();
                OnLookupEvent(new LookupEventArgs(null, lut, LookupSequence.MessageEnd));
                _deQue();
                return;
            }

            var lute = _peekQue();

            switch (lute)
            {
            case LookupType.REQ_TAB_MKC:
                OnLookupEvent(new LookupTableMarketCenterEventArgs(e.textLine));
                return;

            case LookupType.REQ_TAB_MKT:
                OnLookupEvent(new LookupTableMarketEventArgs(e.textLine));
                return;

            case LookupType.REQ_TAB_NAC:
                OnLookupEvent(new LookupTableNaicEventArgs(e.textLine));
                return;

            case LookupType.REQ_TAB_SEC:
                OnLookupEvent(new LookupTableSecurityTypeEventArgs(e.textLine));
                return;

            case LookupType.REQ_TAB_SIC:
                OnLookupEvent(new LookupTableSicEventArgs(e.textLine));
                return;
            }

            throw new Exception("(Lookup Table) NOT HANDLED:" + e.textLine);
        }
        // Events
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith(LookupType.REQ_HST_TCK.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_HST_TCK, LookupSequence.MessageEnd));
                    return;
                }

                OnLookupEvent(new LookupTickEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_HST_INT.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_HST_INT, LookupSequence.MessageEnd));
                    return;
                }

                OnLookupEvent(new LookupIntervalEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_HST_DWM.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_HST_DWM, LookupSequence.MessageEnd));
                    return;
                }

                OnLookupEvent(new LookupDayWeekMonthEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_SYM_SYM.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_SYM_SYM, LookupSequence.MessageEnd));
                    return;
                }
                if (e.textLine.StartsWith(reqId + ",E"))
                {
                    return;
                }

                OnLookupEvent(new LookupSymbolEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_SYM_NAC.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_SYM_NAC, LookupSequence.MessageEnd));
                    return;
                }
                if (e.textLine.StartsWith(reqId + ",E"))
                {
                    return;
                }


                OnLookupEvent(new LookupNaicSymbolEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_SYM_SIC.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_SYM_SIC, LookupSequence.MessageEnd));
                    return;
                }
                if (e.textLine.StartsWith(reqId + ",E"))
                {
                    return;
                }

                OnLookupEvent(new LookupSicSymbolEventArgs(reqId, e.textLine));
                return;
            }

            throw new Exception("(Lookup) NOT HANDLED:" + e.textLine);
        }
Esempio n. 5
0
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith("Q,") || e.textLine.StartsWith("P,"))
            {
                OnLevel1SummaryUpdateEvent(new Level1SummaryUpdateEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("F,"))
            {
                OnLevel1FundamentalEvent(new Level1FundamentalEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("R,"))
            {
                OnLevel1RegionalEvent(new Level1RegionalEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("T,"))
            {
                OnLevel1TimerEvent(new Level1TimerEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("N,"))
            {
                OnLevel1NewsEvent(new Level1NewsEventArgs(e.textLine));
                return;
            }

            if (e.textLine.StartsWith("S,KEY,"))
            {
                // Todo: Process
                return;
            }

            if (e.textLine.StartsWith("S,SERVER CONNECTED"))
            {
                // Todo: Process
                return;
            }

            if (e.textLine.StartsWith("S,SERVER DISCONNECTED"))
            {
                OnLevel1ServerDisconnected(new Level1ServerDisconnectedArgs(e.textLine));
                return;
            }

            if (e.textLine.StartsWith("S,SERVER RECONNECT FAILED"))
            {
                OnLevel1ServerReconnectFailed(new Level1ServerReconnectFailedArgs(e.textLine));
                return;
            }

            if (e.textLine.StartsWith("S,IP,"))
            {
                // Todo: Process
                return;
            }

            if (e.textLine.StartsWith("S,CUST,"))
            {
                // Todo: Process
                return;
            }

            OnLevel1UnknownEvent(new Level1TextLineEventArgs(e.textLine));    
        }
Esempio n. 6
0
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith("S,STATS,"))
            {
                _status.Update(e.textLine);
                return;
            }
            if (e.textLine.StartsWith("S,CLIENTSTATS,"))
            {
                OnClientStatsEvent(new ClientStatsEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("S,REGISTER CLIENT APP COMPLETED,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,REMOVE CLIENT APP COMPLETED,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,CURRENT LOGINID,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,CURRENT PASSWORD,"))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,LOGIN INFO "))
            {
                // placeholder for event
                return;
            }
            if (e.textLine.StartsWith("S,AUTOCONNECT "))
            {
                // placeholder for event
                return;
            }

            throw new Exception("(Admin) NOT HANDLED:" + e.textLine);
         }
Esempio n. 7
0
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith("Q,") || e.textLine.StartsWith("P,"))
            {
                OnLevel1SummaryUpdateEvent(new Level1SummaryUpdateEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("F,"))
            {
                OnLevel1FundamentalEvent(new Level1FundamentalEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("R,"))
            {
                OnLevel1RegionalEvent(new Level1RegionalEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("T,"))
            {
                OnLevel1TimerEvent(new Level1TimerEventArgs(e.textLine));
                return;
            }
            if (e.textLine.StartsWith("N,"))
            {
                OnLevel1NewsEvent(new Level1NewsEventArgs(e.textLine));
                return;
            }

            if (e.textLine.StartsWith("S,KEY,"))
            {
                // Todo: Process
                return;
            }

            if (e.textLine.StartsWith("S,SERVER CONNECTED"))
            {
                // Todo: Process
                return;
            }

            if (e.textLine.StartsWith("S,SERVER DISCONNECTED"))
            {
                OnLevel1ServerDisconnected(new Level1ServerDisconnectedArgs(e.textLine));
                return;
            }

            if (e.textLine.StartsWith("S,SERVER RECONNECT FAILED"))
            {
                OnLevel1ServerReconnectFailed(new Level1ServerReconnectFailedArgs(e.textLine));
                return;
            }

            if (e.textLine.StartsWith("S,IP,"))
            {
                // Todo: Process
                return;
            }

            if (e.textLine.StartsWith("S,CUST,"))
            {
                // Todo: Process
                return;
            }

            OnLevel1UnknownEvent(new Level1TextLineEventArgs(e.textLine));
        }
        // Events
        protected override void OnTextLineEvent(TextLineEventArgs e)
        {
            if (e.textLine.StartsWith(LookupType.REQ_HST_TCK.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_HST_TCK, LookupSequence.MessageEnd));
                    return;
                }

                OnLookupEvent(new LookupTickEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_HST_INT.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_HST_INT, LookupSequence.MessageEnd));
                    return;
                }

                OnLookupEvent(new LookupIntervalEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_HST_DWM.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_HST_DWM, LookupSequence.MessageEnd));
                    return;
                }

                OnLookupEvent(new LookupDayWeekMonthEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_SYM_SYM.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_SYM_SYM, LookupSequence.MessageEnd));
                    return;
                }
                if (e.textLine.StartsWith(reqId + ",E")) { return; }

                OnLookupEvent(new LookupSymbolEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_SYM_NAC.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_SYM_NAC, LookupSequence.MessageEnd));
                    return;
                }
                if (e.textLine.StartsWith(reqId + ",E")) { return; }


                OnLookupEvent(new LookupNaicSymbolEventArgs(reqId, e.textLine));
                return;
            }

            if (e.textLine.StartsWith(LookupType.REQ_SYM_SIC.ToString()))
            {
                var reqId = e.textLine.Substring(0, e.textLine.IndexOf(','));
                if (e.textLine.StartsWith(reqId + ",!ENDMSG!"))
                {
                    OnLookupEvent(new LookupEventArgs(reqId, LookupType.REQ_SYM_SIC, LookupSequence.MessageEnd));
                    return;
                }
                if (e.textLine.StartsWith(reqId + ",E")) { return; }

                OnLookupEvent(new LookupSicSymbolEventArgs(reqId, e.textLine));
                return;
            }

            throw new Exception("(Lookup) NOT HANDLED:" + e.textLine);
        }
Esempio n. 9
0
 protected virtual void OnTextLineEvent(TextLineEventArgs e)
 {
     if (TextLineEvent != null) TextLineEvent(this, e);
 }