예제 #1
0
        /// <summary>
        /// Apply any change in status as a status message and
        /// update to the internal status header
        /// </summary>
        /// <param name="myStatus"></param>
        private void updateStatus(KaiTrade.Interfaces.Status myStatus)
        {
            try
            {
                // if the status has changes then do an
                // status update
                if (m_PubStatus != myStatus)
                {
                    m_PubStatus = myStatus;
                    m_Status = new K2DataObjects.Field("STATUS", myStatus.ToString());
                    m_StatusInfo = new System.Collections.Generic.List<KaiTrade.Interfaces.IField>();
                    m_StatusInfo.Add(m_Status);
                    applyStatus(m_StatusInfo);
                }

                // then update the synthetic status field

                doUpdate();
            }
            catch (Exception myE)
            {
                m_Log.Error("updateStatus", myE);
            }
        }
예제 #2
0
        public Publisher()
        {
            m_Log = log4net.LogManager.GetLogger("KaiTrade");

            m_Fields = new Dictionary<string, KaiTrade.Interfaces.IField>();

            m_UpdateFields = new Dictionary<string, KaiTrade.Interfaces.IField>();
            m_Subscribers = new System.Collections.Generic.List<KaiTrade.Interfaces.ISubscriber>();

            m_StatusInfo = new System.Collections.Generic.List<KaiTrade.Interfaces.IField>();
            m_Image = new System.Collections.Hashtable();

            //NOT USED? m_isChanged = false;
            m_PubStatus = KaiTrade.Interfaces.Status.opening;
        }
예제 #3
0
        /// <summary>
        /// set status and report change
        /// </summary>
        /// <param name="myStatus"></param>
        public void setStatus(KaiTrade.Interfaces.Status myStatus)
        {
            try
            {
                _status = myStatus;
                this.SendStatusMessage(KaiTrade.Interfaces.Status.open, Name + "Status changed to:" + _status.ToString());
                this.SendAdvisoryMessage(Name + "Status changed to:" + _status.ToString());
                log.Info(Name + "Status changed to:" + _status.ToString());
                wireLog.Info(Name + "Status changed to:" + _status.ToString());
            }
            catch (Exception myE)
            {
                log.Error("setStatus", myE);

            }
        }