Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 2
0
        //
        //
        #endregion//Constructors


        #region Public Methods
        // *****************************************************************
        // ****                     Public Methods                      ****
        // *****************************************************************
        //
        //
        /// <summary>
        /// Called by non-gui thread to create a LogViewer.
        /// </summary>
        /// <param name="o"></param>
        /// <param name="msg"></param>
        public void CreateInvoke(object o, string msg)
        {
            CreatorEventArgs args = new CreatorEventArgs();

            args.Message = msg;
            this.CreateInvoke(o, args);
        }