コード例 #1
0
        private void CreateInvoke(object o, EventArgs eArgs)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new EventHandler(CreateInvoke), new object[] { o, eArgs });
                //IAsyncResult res = this.BeginInvoke(new EventHandler(CreateInvoke), new object[] { o, eArgs });
                //this.EndInvoke(res);

                /*
                 * LogHub logHub = (LogHub)o;
                 * if (logHub.m_ErrorView != null)
                 * {
                 *  logHub.m_ErrorView.AddMessage("Awesome!");
                 * }
                 * else
                 * {
                 *  int nn = 0;
                 * }
                 */
            }
            else
            {
                LogHub           logHub = (LogHub)o;
                CreatorEventArgs e      = (CreatorEventArgs)eArgs;
                LogViewer        v      = new LogViewer(logHub, true);
                v.Text    = logHub.LogName + " Error";
                v.TopMost = true;
                v.Show();
                v.AddMessage(e.Message);
                if (logHub.m_ErrorView == null)
                {
                    logHub.m_ErrorView = v;
                }
            }
        }
コード例 #2
0
        //
        private void InitializeLogHub(LogHub logHub, string windowName)
        {
            m_LogHub  = logHub;
            this.Text = windowName;

            // Initialize my timer.
            m_Timer          = new Timer();
            m_Timer.Interval = 100;// (int)(1000 * m_UpdateIntervalSeconds);
            m_Timer.Tick    += new EventHandler(Timer_Tick);
            if (m_UpdateIntervalSeconds > 0)
            {
                m_Timer.Interval = (int)(1000 * m_UpdateIntervalSeconds);
                //m_Timer.Enabled = true;
                m_Timer.Start();
            }

            //
            // Create our combo box for message levels
            //
            string currentMsgLevel = Enum.GetName(typeof(LogLevel), m_LogHub.AllowedMessages);

            comboLogLevel.BeginUpdate();
            foreach (string level in Enum.GetNames(typeof(LogLevel)))
            {
                comboLogLevel.Items.Add(level);
            }
            comboLogLevel.SelectedItem = currentMsgLevel;
            comboLogLevel.EndUpdate();

            m_LastUpdateColor[0] = textLastUpdate.BackColor;
            m_LastUpdateColor[1] = System.Drawing.Color.Yellow;
        }
コード例 #3
0
 public LogViewer(LogHub loghub, bool disableUserControls)
 {
     InitializeComponent();
     InitializeLogHub(loghub, loghub.LogName + " Log");
     if (disableUserControls)
     {
         this.comboLogLevel.Visible = false;
     }
 }
コード例 #4
0
        // *****************************************************************
        // ****                     Constructors                        ****
        // *****************************************************************
        public EventWaitQueue(LogHub aLog)
        {
            this.Log = aLog;

            int timerPeriod = (int)Math.Round(1000 * m_FirstAttempTimeDelaySecs);

            m_Timer = new System.Threading.Timer(new System.Threading.TimerCallback(Timer_CallBack),
                                                 null, System.Threading.Timeout.Infinite, timerPeriod);
            int timerDelayStart = timerPeriod;

            m_Timer.Change(timerDelayStart, timerPeriod);                           // starting the timer.
        }
コード例 #5
0
        //
        //
        #endregion// members


        #region Constructors
        // *****************************************************************
        // ****                     Constructors                        ****
        // *****************************************************************
        public FormAddFills(Ambre.TTServices.Markets.MarketTTAPI priceHub, FillHub aFillHub)
        {
            InitializeComponent();
            Log       = aFillHub.Log;
            m_FillHub = aFillHub;
            m_Market  = priceHub;

            this.buttonDeleteBook.Text    = ButtonDeleteBook_Normal;        // set this to normal
            this.buttonDeleteBook.Enabled = true;                           // TODO: disable until i can work out the "dupe key" problems.
            //#if (DEBUG)
            //    this.buttonDeleteBook.Enabled = false;
            //#endif
        }
コード例 #6
0
        //
        //
        #endregion// members

        #region Constructors
        // *****************************************************************
        // ****                     Constructors                        ****
        // *****************************************************************
        //
        public LogViewer(LogHub loghub)
        {
            InitializeComponent();
            InitializeLogHub(loghub, loghub.LogName + " Log");
        }
コード例 #7
0
ファイル: Hub.cs プロジェクト: nagyist/mkbiltek.trading
        public LogHub Log;                               // multithreaded Log file server.


        #endregion//members


        #region Constructor
        // *****************************************************************
        // ****                 Constructor                             ****
        // *****************************************************************
        public Hub(string hubName, string logDirName, bool isLogViewDesired, LogLevel logLevel)
            : base(hubName)
        {
            Log = new LogHub(hubName, logDirName, isLogViewDesired, logLevel);    // log is self-starting.
        }//end constructor.
コード例 #8
0
        }//

        //
        //
        //
        //
        private void FormAddFills_FormClosing(object sender, FormClosingEventArgs e)
        {
            m_Market  = null;
            m_FillHub = null;
            Log       = null;
        }