Exemplo n.º 1
0
 void Logger_OnLogEvent(object sender, StatusEventArgs e)
 {
     if (this.statusStrip1.InvokeRequired)
     {
         SetStatusTextCallback d = new SetStatusTextCallback(Logger_OnLogEvent);
         this.Invoke(d, new object[] { this, e });
     }
     else
     {
         SetMessageText(e.Message);
     }
 }
Exemplo n.º 2
0
 private void SetStatusText(String newtext)
 {
     if (this.txtStatus.InvokeRequired)
     {
         SetStatusTextCallback d = new SetStatusTextCallback(SetStatusText);
         this.Invoke(d, new object[] { newtext });
     }
     else
     {
         this.txtStatus.Text = newtext;
     }
 }
Exemplo n.º 3
0
 public void SetStatusText(string text)
 {
     if (this.lblStatus.InvokeRequired)
     {
         SetStatusTextCallback d = new SetStatusTextCallback(SetStatusText);
         this.Invoke(d, new object[] { text });
     }
     else
     {
         this.lblStatus.Text = text;
     }
 }
Exemplo n.º 4
0
 //Método de chamada com sincronização de threads para alterar o texto da label de status
 private void setStatusText(string p_Text)
 {
     if (m_LblSpheroStatus.InvokeRequired)
     {
         SetStatusTextCallback v_Callback = new SetStatusTextCallback(setStatusText);
         this.Invoke(v_Callback, new object[] { p_Text });
     }
     else
     {
         m_LblSpheroStatus.Text = p_Text;
     }
 }
Exemplo n.º 5
0
 public void SetStatusText(String text)
 {
     if (label_status.InvokeRequired)
     {
         SetStatusTextCallback d = new SetStatusTextCallback(SetStatusText);
         this.Invoke(d, new Object[] { text });
     }
     else
     {
         label_status.Text = text;
     }
 }
Exemplo n.º 6
0
 private void SetLobbyBoxText(string text)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (_lobbyMessageBox.InvokeRequired)
     {
         SetStatusTextCallback d = SetLobbyBoxText;
         _lobbyMessageBox.Invoke(d, text);
     }
     else
     {
         _lobbyMessageBox.Text = text;
     }
 }
Exemplo n.º 7
0
 private void SetSteamStatusText(string text)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (SteamStatusLabel.InvokeRequired)
     {
         SetStatusTextCallback d = SetSteamStatusText;
         Invoke(d, text);
     }
     else
     {
         SteamStatusLabel.Text = "Status: " + text;
     }
 }
Exemplo n.º 8
0
        public void setStatusText(string msg)
        {
            //把鼠标放上去看解释就知道了,就是防止创建控件以外的线程调用(.NET是类型安全的)
            if (this.statusStrip.InvokeRequired)
            {
                //为当前控件指定委托
                SetStatusTextCallback d = new SetStatusTextCallback(setStatusText);
                this.Invoke(d, new object[] { msg });

                //this.Invoke(new addms g(AddMsg), msg);
            }
            else
            {
                //被委托到主线程后真正执行的代码
                //为什么会执行到这里?
                //不好解释,大概是因为委托的主线程后,this.InvokeRequired=false了吧
                this.toolStripStatusLabel_download_status.Text = msg;
            }
        }
 public void SetStatusText(string status)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.statusStrip.InvokeRequired)
     {
         SetStatusTextCallback d = new SetStatusTextCallback(SetStatusText);
         try
         {
             this.Invoke(d, new object[] { status });
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.StackTrace);
             Application.Exit();
         }
     }
     else
     {
         this.statusText.Text = status;
     }
 }
Exemplo n.º 10
0
		private void SetETAText(string text)
		{
			if (label11.InvokeRequired)
			{
				SetStatusTextCallback d = new SetStatusTextCallback(SetETAText);
				this.Invoke(d, new object[] { text });
			}
			else
				label11.Text = text;
			Application.DoEvents();
		}
Exemplo n.º 11
0
 private void SetStatusText(string text)
 {
     if ( this.tbStatus.InvokeRequired)
     {
         SetStatusTextCallback s = new SetStatusTextCallback(SetStatusText);
         this.Invoke(s, new object[] { text });
     }
     else
     {
         this.tbStatus.Text = text;
     }
 }
Exemplo n.º 12
0
 private void SetStatusText(string text)
 {
   // Make sure we're calling this method from the correct thread...
   if (statusBar1.InvokeRequired)
   {
     SetStatusTextCallback d = new SetStatusTextCallback(SetStatusText);
     this.Invoke(d, new object[] {text});
   }
   else
   {
     statusBar1.Text = text;
   }
 }
Exemplo n.º 13
0
 private void SetStatusText(string text)
 {
     try
     {
         if (this.InvokeRequired)
         {
             SetStatusTextCallback d = new SetStatusTextCallback(SetStatusText);
             this.Invoke(d, new object[] { text });
         }
         else
         {
             statusText.Text = text;
         }
     }
     catch (ObjectDisposedException)
     { }
 }
Exemplo n.º 14
0
 void Logger_OnLogEvent(object sender, StatusEventArgs e)
 {
     if (this.statusStrip1.InvokeRequired)
     {
         SetStatusTextCallback d = new SetStatusTextCallback(Logger_OnLogEvent);
         this.Invoke(d, new object[] { this, e });
     }
     else
     {
         SetMessageText(e.Message);
     }
 }