/// <summary> /// UI Control /// </summary> /// <param name="text"></param> #region UI Control //For Log calls public void logCall(bool sent, string text) { invokeDelegate del = () => { logData(sent, text); }; Invoke(del); }
private void tcpServer1_OnConnect(tcpServer.TcpServerConnection connection) { invokeDelegate setText = () => lblConnected.Text = tcpServer1.Connections.Count.ToString(); Invoke(setText); while (tcpServer1.Connections.Count != 0) { toolStripStatusLabel4.Text = "Connection: 1 !"; toolStripStatusLabel4.BackColor = Color.Lime; } }
private void ShowCompleted() { if (this.InvokeRequired) { invokeDelegate updateControl = delegate() { }; updateControl = ShowCompleted; Invoke(updateControl); } this.SetPages(); this.CheckEnable(); this.printButton.Enabled = true; this.pdfButton.Enabled = true; this.UpdateToolStrip(); ShowSelectedPage(); }
private void tcpServer1_OnDataAvailable(tcpServer.TcpServerConnection connection) { byte[] data = readStream(connection.Socket); if (data != null) { string dataStr = Encoding.ASCII.GetString(data); invokeDelegate del = () => { logData(false, dataStr); }; Invoke(del); data = null; } }
private void UpdateToolStrip() { if (this.InvokeRequired) { invokeDelegate updateControl = delegate() { }; updateControl = UpdateToolStrip; Invoke(updateControl); } if (this.toolStrip1 != null) { string str = String.Empty; if (this.Pages != null) { str = String.Format(CultureInfo.CurrentCulture, "of {0}", this.Pages.Count); } this.numericToolStripTextBox2.Text = (this.pageNumber + 1).ToString(CultureInfo.CurrentCulture); this.pageInfoLabel.Text = str; } }
private void _tcpServer_OnDataAvailable(TcpServerConnection connection) { byte[] data = readStream(connection.Socket); if (data != null) { //string dataStr = Encoding.ASCII.GetString(data); try { invokeDelegate del = () => { ParseSvsData(data); }; Invoke(del); data = null; } catch { } } }
private void ShowSelectedPage() { if (this.InvokeRequired) { invokeDelegate updateControl = delegate(){}; updateControl = ShowSelectedPage; Invoke(updateControl); } if (this.pageNumber < this.pages.Count) { ExporterPage sp = pages[this.pageNumber]; if (this.bitmap != null) { this.bitmap.Dispose(); } this.bitmap = this.CreateBitmap(sp); this.Invalidate(true); this.Update(); } this.UpdateToolStrip(); }
private void tcpServer1_OnConnect(tcpServer.TcpServerConnection connection) { invokeDelegate setText = () => lbconnectstate.Text = GT_DataPusher.m_object.Connections.Count > 0? "Connect" : "Not Connect"; Invoke(setText); }
private void tcpServer4_OnConnect(tcpServer.TcpServerConnection connection) { invokeDelegate setText = () => lblConnected4.Text = tcpServer4.Connections.Count.ToString(); Invoke(setText); }