System.Windows.Forms.Control.BeginInvoke(System.Delegate, params object[])

Here are the examples of the csharp api class System.Windows.Forms.Control.BeginInvoke(System.Delegate, params object[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

View license
protected void InvokeLayout()
        {
            // We want a layout to occur but not until the message loop
            // is spun. So this will happen before any painting because
            // paint messages only occur when the message queue is empty.
            if (IsHandleCreated && !IsDisposed)
                BeginInvoke(_layoutCall);
        }

2. Example

Project: Krypton
Source File: VisualControlBase.cs
View license
protected void InvokeLayout()
        {
            // We want a layout to occur but not until the message loop
            // is spun. So this will happen before any painting because
            // paint messages only occur when the message queue is empty.
            BeginInvoke(_layoutCall);
        }

3. Example

Project: JiraSVN
Source File: BindingComboBox.cs
View license
void BindingComboBox_SelectedIndexChanged(object sender, EventArgs e)
		{
			if(IndexSelectedChanged != null)
				this.BeginInvoke(IndexSelectedChanged, sender, e);
		}

4. Example

Project: dp2
Source File: GetSqlServerDlg.cs
View license
private void SqlServerDlg_Load(object sender, EventArgs e)
        {
            // FillList();

            this.BeginInvoke(new Delegate_FillList(FillList));
        }

5. Example

Project: dp2
Source File: ListViewUtil.cs
View license
public static void BeginSelectItem(Control control, ListViewItem item)
        {
            control.BeginInvoke(new Action<ListViewItem>(
                (o) =>
                {
                    o.Selected = true;
                    o.EnsureVisible();
                }), item);
        }

6. Example

Project: dp2
Source File: LoginDlg.cs
View license
private void LoginDlg_Load(object sender, System.EventArgs e)
		{
			if (textBox_comment.Text == "")
				textBox_comment.Visible = false;

            this.BeginInvoke(new Delegate_SetFocus(SetFocus));
		}

7. Example

Project: dp2
Source File: KernelCfgFileDialog.cs
View license
private void KernelCfgFileDialog_Load(object sender, EventArgs e)
        {
            this.Changed = false;
            this.BeginInvoke(new Action(FocusEdit));
        }

8. Example

Project: dp2
Source File: ObjectViewerDialog.cs
View license
private void ObjectViewerDialog_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.Url) == false)
                this.BeginInvoke(new Action<string>(Navigate), this.Url);
        }

9. Example

Project: dp2
Source File: CameraClipDialog.cs
View license
internal void EndCatch()
        {
            Delegate_EndCatch d = new Delegate_EndCatch(_endCatch);
            this.BeginInvoke(d);
        }

10. Example

Project: dp2
Source File: CameraPhotoDialog.cs
View license
internal void EndCatch()
        {
            Delegate_EndCatch d = new Delegate_EndCatch(_endCatch);
            this.BeginInvoke(d);
        }

11. Example

Project: dp2
Source File: MarcFixedFieldControl.cs
View license
public void BeginShowValueList(
            int nCurLine,
            int nCaretPosition,
            int nLineChars,
            string strCurLine)
        {
            this.nCurLine = nCurLine;

            object[] pList = { nCaretPosition, nLineChars, strCurLine };

            this.BeginInvoke(new Delegate_ShowValueList(ShowValueList),
                pList);
        }

12. Example

Project: dp2
Source File: GetDbNameDlg.cs
View license
private void GetDbNameDlg_Load(object sender, EventArgs e)
        {
            // ????????
            if (this.m_strDbType == "biblio")
            {
                if (Program.MainForm != null
                    && Program.MainForm.BiblioDbProperties != null)
                {
                    for (int i = 0; i < Program.MainForm.BiblioDbProperties.Count; i++)
                    {
                        this.listBox_biblioDbNames.Items.Add(Program.MainForm.BiblioDbProperties[i].DbName);
                    }
                }
            }
            else if (this.m_strDbType == "reader")
            {
                if (Program.MainForm != null
                    && Program.MainForm.ReaderDbNames != null)
                {
                    for (int i = 0; i < Program.MainForm.ReaderDbNames.Length; i++)
                    {
                        this.listBox_biblioDbNames.Items.Add(Program.MainForm.ReaderDbNames[i]);
                    }
                }
            }

            // ????
            if (String.IsNullOrEmpty(this.DbName) == false)
            {
                this.listBox_biblioDbNames.SelectedItem = this.DbName;
                this.BeginInvoke(new Action(EnsureSelectedLineVisible));
            }

            if (this.EnableNotAsk == true)
                this.checkBox_notAsk.Enabled = true;

            if (this.AutoClose == true)
                API.PostMessage(this.Handle, WM_AUTO_CLOSE, 0, 0);
        }

13. Example

Project: dp2
Source File: GetMergeStyleDialog.cs
View license
private void GetMergeStyleDialog_Load(object sender, EventArgs e)
        {
            this.BeginInvoke(new Action(AutoSet));
        }

14. Example

Project: dp2
Source File: BiblioDupDialog.cs
View license
private void BiblioDupDialog_Load(object sender, EventArgs e)
        {
            this.BeginInvoke(new Action(FillBrowseList));
        }

15. Example

Project: dp2
Source File: DateSliceDialog.cs
View license
private void comboBox_quickSetTimeRange_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.IsHandleCreated == false)
                return;

            Delegate_QuickSetTimeRange d = new Delegate_QuickSetTimeRange(QuickSetTimeRange);
            this.BeginInvoke(d, new object[] { sender });
        }

16. Example

Project: dp2
Source File: MainForm.cs
View license
public void Beep(FingerprintServer server, int nCount)
        {
            if (this.InvokeRequired)
            {
                _Beep d = new _Beep(Beep);
                this.BeginInvoke(d, new object[] { server, nCount });
            }
            else
            {
                if (m_bBeep == true)
                    server.Beep(nCount);
            }
        }

17. Example

Project: dp2
Source File: MainForm.cs
View license
public void Light(FingerprintServer server, string strColor)
        {
            if (this.InvokeRequired)
            {
                _Light d = new _Light(Light);
                this.BeginInvoke(d, new object[] { server, strColor });
            }
            else
            {
                server.Light(strColor);
            }
        }

18. Example

Project: JacktheRipperBot
Source File: MainForm.cs
View license
private void UpdateProgress
            (
            string Message
            )
        {
            if (InvokeRequired)
            {
                BeginInvoke(new Action<string>(UpdateProgress), Message);
                return;
            }

            ProgressText.Text = Message;
        }

19. Example

View license
public void InvokeLater(Action action) {
      BeginInvoke(action);
    }

20. Example

Project: google-drive-proxy
Source File: StateForm.cs
View license
private void labelCancelAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
      try
      {
        if (InvokeRequired)
        {
          BeginInvoke(new LinkLabelLinkClickedEventHandler(labelCancelAll_LinkClicked), new[] {sender, e});
          return;
        }

        for (int i = 0; i < panelBody.Controls.Count; i++)
        {
          var stateControl = panelBody.Controls[i] as StateControl;

          if (stateControl != null)
          {
            stateControl.Cancel();
          }
        }
      }
      catch (Exception exception)
      {
        Log.Error(exception, false);
      }
    }

21. Example

Project: google-drive-proxy
Source File: StateForm.cs
View license
public void State_FinishedStream(DriveProxy.API.DriveService.State sender, API.DriveService.Stream stream)
    {
      try
      {
        if (InvokeRequired)
        {
          BeginInvoke(new DriveProxy.API.DriveService.State.StreamHandler(State_FinishedStream),
                      new object[] {sender, stream});
          return;
        }

        for (int i = 0; i < panelBody.Controls.Count; i++)
        {
          var stateControl = panelBody.Controls[i] as StateControl;

          if (stateControl != null)
          {
            if (stateControl.Stream == stream)
            {
              if (stream.Failed)
              {
                _hasError = true;
              }
              break;
            }
          }
        }
      }
      catch (Exception exception)
      {
        Log.Error(exception, false);
      }
    }

22. Example

Project: openHistorian
Source File: ComparisonUtility.cs
View license
private void EnableGoButton(bool enabled)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<bool>(EnableGoButton), enabled);
            }
            else
            {
                buttonGo.Enabled = enabled;
            }
        }

23. Example

Project: openHistorian
Source File: ComparisonUtility.cs
View license
private void UpdateProgressBar(int value)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<int>(UpdateProgressBar), value);
            }
            else
            {
                if (value < progressBar.Minimum)
                    value = progressBar.Minimum;

                if (value > progressBar.Maximum)
                    progressBar.Maximum = value;

                progressBar.Value = value;
            }
        }

24. Example

Project: openHistorian
Source File: ComparisonUtility.cs
View license
private void SetProgressMaximum(int maximum)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<int>(SetProgressMaximum), maximum);
            }
            else
            {
                progressBar.Maximum = maximum;
            }
        }

25. Example

Project: openHistorian
Source File: MigrationUtility.cs
View license
private void EnableGoButton(bool enabled)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<bool>(EnableGoButton), enabled);
            }
            else
            {
                if (!m_operationStarted)
                    buttonGo.Enabled = enabled;
            }
        }

26. Example

Project: openHistorian
Source File: MigrationUtility.cs
View license
private void UpdateProgressBar(int value)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<int>(UpdateProgressBar), value);
            }
            else
            {
                progressBar.Value = value;
            }
        }

27. Example

Project: openHistorian
Source File: MigrationUtility.cs
View license
private void SetProgressMaximum(int maximum)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<int>(SetProgressMaximum), maximum);
            }
            else
            {
                progressBar.Maximum = maximum;
            }
        }

28. Example

Project: openHistorian
Source File: MigrationUtility.cs
View license
private void UpdateInstanceName(string instanceName)
        {
            if (m_formClosing)
                return;

            if (InvokeRequired)
            {
                BeginInvoke(new Action<string>(UpdateInstanceName), instanceName);
            }
            else
            {
                textBoxInstanceName.Text = instanceName;
            }
        }

29. Example

View license
private void BeginUpdateListItemState(ListViewItem item,string text)
        {
            UpdatePatchingMessageDelegate upmd = new UpdatePatchingMessageDelegate(UpdatePatchingMessage);
            this.BeginInvoke(upmd, item, text);
        }

30. Example

Project: 32feet
Source File: SelectBluetoothDeviceForm.cs
View license
void bco_DiscoverDevicesComplete(object sender, DiscoverDevicesEventArgs e)
        {
            var dlgt = new EventHandler<DiscoverDevicesEventArgs>(UpdateCompleted);
            lvDevices.BeginInvoke(dlgt, this, e);
            //
            var bco = (BluetoothComponent)e.UserState;
            bco.Dispose();
        }

31. Example

Project: halcyon
Source File: frmGridAccountant.cs
View license
protected void BalanceHandler(object sender, PacketReceivedEventArgs e)
		{
            Packet packet = e.Packet;
            string value = ((MoneyBalanceReplyPacket)packet).MoneyData.MoneyBalance.ToString();
            this.BeginInvoke(new StringParamInvoker(UpdateBalance), new object[] { value });
		}

32. Example

Project: halcyon
Source File: frmGridAccountant.cs
View license
private void DirPeopleHandler(object sender, PacketReceivedEventArgs e)
		{
            Packet packet = e.Packet;
            
            DirPeopleReplyPacket reply = (DirPeopleReplyPacket)packet;

            foreach (DirPeopleReplyPacket.QueryRepliesBlock block in reply.QueryReplies)
            {
                ListViewItem listItem = new ListViewItem(new string[] { 
                Utils.BytesToString(block.FirstName) + " " + Utils.BytesToString(block.LastName), 
                (block.Online ? "Yes" : "No"), block.AgentID.ToString() });

                this.BeginInvoke(new ListViewItemParamInvoker(AddFindItem), new object[] { listItem });
            }
		}

33. Example

Project: mutefm
Source File: InitWizForm.cs
View license
void InitWizForm_DocumentReady(object sender, Awesomium.Core.UrlEventArgs e)
        {
            w/n ..... /n //View Source file for more details /n }

34. Example

Project: gitter
Source File: CustomListBoxItem.cs
View license
public void InvalidateSafe()
		{
			var listBox = ListBox;
			if(listBox != null)
			{
				if(listBox.InvokeRequired)
				{
					Action<CustomListBoxItem> action = listBox.InvalidateItem;
					listBox.BeginInvoke(action, new object[] { this });
				}
				else
				{
					listBox.InvalidateItem(this);
				}
			}
		}

35. Example

Project: gitter
Source File: CustomListBoxItem.cs
View license
public void InvalidateSubItemSafe(int id)
		{
			var listBox = ListBox;
			if(listBox != null && IsPresented)
			{
				if(listBox.InvokeRequired)
				{
					Action<CustomListBoxItem, int> action = listBox.InvalidateSubItem;
					listBox.BeginInvoke(action, this, id);
				}
				else
				{
					listBox.InvalidateSubItem(this, id);
				}
			}
		}

36. Example

Project: gitter
Source File: ProgressForm.cs
View license
public void SetAction(string action)
		{
			if(!IsDisposed)
			{
				if(InvokeRequired)
				{
					try
					{
						BeginInvoke(new Action<string>(SetAction), action);
					}
					catch(ObjectDisposedException)
					{
					}
				}
				else
				{
					_lblAction.Text = action;
				}
			}
		}

37. Example

Project: gitter
Source File: MainForm.cs
View license
private void OnCurrentProgressChanged(object sender, EventArgs e)
		{
			if(InvokeRequired)
			{
				BeginInvoke(new EventHandler(OnCurrentProgressChanged), sender, e);
			}
			else
			{
				_updateProgress.Value = _monitor.CurrentProgress;
			}
		}

38. Example

Project: gitter
Source File: MainForm.cs
View license
private void OnMaximumProgressChanged(object sender, EventArgs e)
		{
			if(InvokeRequired)
			{
				BeginInvoke(new EventHandler(OnMaximumProgressChanged), sender, e);
			}
			else
			{
				_updateProgress.Maximum = _monitor.MaximumProgress;
			}
		}

39. Example

Project: gitter
Source File: MainForm.cs
View license
private void OnStageChanged(object sender, EventArgs e)
		{
			if(InvokeRequired)
			{
				BeginInvoke(new EventHandler(OnStageChanged), sender, e);
			}
			else
			{
				_lblStage.Text = _monitor.Stage;
			}
		}

40. Example

Project: gitter
Source File: MainForm.cs
View license
private void OnCanCancelChanged(object sender, EventArgs e)
		{
			if(InvokeRequired)
			{
				BeginInvoke(new EventHandler(OnCanCancelChanged), sender, e);
			}
			else
			{
				if(!_monitor.CancelRequested)
				{
					_btnCancel.Enabled = _monitor.CanCancel;
				}
			}
		}

41. Example

Project: NLog
Source File: RichTextBoxTarget.cs
View license
protected override void Write(LogEventInfo logEvent)
        {
            RichTextBoxRowColoringRule matchingRule = null;

            foreach (RichTextBoxRowColoringRule rr in this.RowColoringRules)
            {
                if (rr.CheckCondition(logEvent))
                {
                    matchingRule = rr;
                    break;
                }
            }

            if (this.UseDefaultRowColoringRules && matchingRule == null)
            {
                foreach (RichTextBoxRowColoringRule rr in DefaultRowColoringRules)
                {
                    if (rr.CheckCondition(logEvent))
                    {
                        matchingRule = rr;
                        break;
                    }
                }
            }

            if (matchingRule == null)
            {
                matchingRule = RichTextBoxRowColoringRule.Default;
            }
            
            string logMessage = this.Layout.Render(logEvent);

            this.TargetRichTextBox.BeginInvoke(new DelSendTheMessageToRichTextBox(this.SendTheMessageToRichTextBox), new object[] { logMessage, matchingRule });
        }

42. Example

Project: sharpmaptracker
Source File: MainForm.cs
View license
private void ReadTibiaCastFilesCallback(IAsyncResult ar)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new Action<IAsyncResult>(ReadTibiaCastFilesCallback), ar);
                return;
            }

            var tile = map.Tiles.FirstOrDefault();

            if (tile != null && miniMap.CenterLocation == null)
                miniMap.CenterLocation = tile.Location;

            miniMap.EndUpdate();
        }

43. Example

Project: lphant
Source File: FormSearch.cs
View license
private void m_InvokeOnNewSearched(InterfaceSearchedFile file, int searchID)
		{
			this.BeginInvoke(new SearchEvent(m_OnNewSearched),new object[] {file,searchID});
		}

44. Example

Project: lphant
Source File: FormSearch.cs
View license
private void m_InvokeOnModifiedSearched(InterfaceSearchedFile file, int searchID)
		{
			this.BeginInvoke(new SearchEvent(m_OnModifiedSearched),new object[] {file,searchID});
		}

45. Example

Project: lphant
Source File: FormSearch.cs
View license
private void m_InvokeOnEndSearch(int searchID)
		{
			this.BeginInvoke(new EndSearchEvent(m_OnEndSearch),new object[] {searchID});
		}

46. Example

Project: lphant
Source File: FormServers.cs
View license
public void OnLog(Constants.Log importance,string strMsg)
		{
			this.BeginInvoke(logDelegate,new object[] {this,importance,strMsg});
		}

47. Example

Project: scallion
Source File: InputLogger.cs
View license
void hidden_Unload(object sender, EventArgs e)
        {
            this.BeginInvoke(on_hidden_unload, sender, e, this);
        }

48. Example

Project: scallion
Source File: InputLogger.cs
View license
void LogMouseMove(object sender, MouseMoveEventArgs e)
        {
            this.BeginInvoke(ControlLogMouseMoveChanges, hidden, this, sender, e);
        }

49. Example

Project: scallion
Source File: InputLogger.cs
View license
void LogMouseWheelChanged(object sender, MouseWheelEventArgs e)
        {
            this.BeginInvoke(ControlLogMouseWheelChanges, hidden, this, sender, e);
        }

50. Example

Project: scallion
Source File: InputLogger.cs
View license
void LogMouseButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.BeginInvoke(ControlLogMouseKeyDown, hidden, this, sender, e);
        }