public OrderWizard(CarSharingService service, Car car, IAuthorizedUser user, updateUI updateWidth, updateUI updateList) { InitializeComponent(); CarSharingService = service; itemToOrder = car; authorizedUser = user; UpdateWidth = updateWidth; UpdateList = updateList; }
private void Update_Text(string str, Control ctl) { if (ctl.InvokeRequired) { updateUI uu = new updateUI(Update_Text); ctl.Invoke(uu, str, ctl); } else { ctl.Text += str; } }
/// <summary> /// 更新所有节点的生命信号的状态 /// </summary> /// <param name="lifeSigNode1"></param> /// <param name="lifeSigNode2"></param> /// <param name="lifeSigNode3"></param> /// <param name="lifeSigNode4"></param> /// <param name="lifeSigNode5"></param> /// <param name="lifeSigNode6"></param> public void UpdateNode(int lifeSigNode1, int lifeSigNode2, int lifeSigNode3, int lifeSigNode4, int lifeSigNode5, int lifeSigNode6) { preLifeSigNode1 = lifeSigNode1; preLifeSigNode2 = lifeSigNode2; preLifeSigNode3 = lifeSigNode3; preLifeSigNode4 = lifeSigNode4; preLifeSigNode5 = lifeSigNode5; preLifeSigNode6 = lifeSigNode6; CheckAllNode(); if (asyncUpdateUI == null) { asyncUpdateUI = new updateUI(UpdateUIHandler); } asyncUpdateUI.Invoke(stateNode1, stateNode2, stateNode3, stateNode4, stateNode5, stateNode6); }
private async void LongRunning(PauseTokenSource pause) { _updateGUI = new updateUI(SetUI); for (int i = 0; i < 20; i++) { await pause.WaitWhilePausedAsync(); Thread.Sleep(500); this.Invoke(_updateGUI, i.ToString() + " => " + txtInput.Text); //txtOutput.AppendText(Environment.NewLine + i.ToString()); if (_cancelToken.IsCancellationRequested) { this.Invoke(_updateGUI, "Task cancellation requested at " + DateTime.Now.ToString()); break; } } _updateGUI = null; }
public Frm_Publishing() { InitializeComponent(); ShowTextDelegate = new updateUI(ShowText); progressBar1.Location = new Point((gb_Publish.Width / 2 - progressBar1.Width / 2), (gb_Publish.Height / 2 - progressBar1.Height / 2)); }
private void MainWindow_Load(object sender, EventArgs e) { Process.Start("转运中心.exe"); this.dgvMsg.AutoGenerateColumns = false; CommonData.errorLabel = lblError; //登录摄像头 StreamReader sr = new StreamReader("xdview.cfg"); xDview.URL = sr.ReadLine(); xDview.Port = int.Parse(sr.ReadLine()); xDview.UserName = sr.ReadLine(); xDview.UserPswd = sr.ReadLine(); xDview.ChannelNum = "0"; int r = xDview.LoginNVS(); xDview.StartView(); //读取配置文件 //查询垃圾楼信息 string sql = "SELECT * FROM [dbo.Station]"; BaseOperate op = new BaseOperate(); DataSet ds = op.getds(sql,"[dbo.Station]"); if (ds.Tables.Count != 0) CommonData.stations = ds.Tables[0]; bgwUpdateUI_DoWork(); //创建读卡线程 readCardThread = new Thread(this.readCard); readCardThread.Start(); //创建更新数据线程 updateDBThread = new Thread(this.updateDB); updateDBThread.Start(); //设置UI代理 fUpui = updateUIFunc; this.lblStation.Text = CommonData.stationName; }
public frmChatClient() { InitializeComponent(); updateUi = new updateUI(update); CheckForIllegalCrossThreadCalls = false; }