public ChatServer() { InitializeComponent(); this.setListBoxCallback = new SetListBoxCallBack(SetListBox); this.setComboBoxCallback = new SetComboBoxCallBack(AddComboBoxItem); IPAddress[] addrIP = Dns.GetHostAddresses(this.txtIP.Text); //ip地址 localAddress = addrIP[0]; }
private void SetListBox(ListBox lb, string s) { if (lb.InvokeRequired) { SetListBoxCallBack d = new SetListBoxCallBack(SetListBox); this.Invoke(d, new object[] { lb, s }); } else { lb.Items.Add(s); } }
public FrmCollect() { InitializeComponent(); MsgPingCallBack = new SetListBoxCallBack(PingLogMsg); PingComputer.OnPingnotConnected += new ViewEventHandler(Ping_OnConnectLogEvent); MsgEqmInfoCallBack = new SetListBoxCallBack(EqmInfoLogMsg); CollectData.OnConnectStatusInfo += new ViewEventHandler(EqmInfo_OnConnectLogEvent); listEqmInfo.View = View.Details;//设置视图 listEqmInfo.Columns.Add("设备编号", 140, HorizontalAlignment.Left); listEqmInfo.Columns.Add("IP地址", 140, HorizontalAlignment.Left); listEqmInfo.Columns.Add("状态", 140, HorizontalAlignment.Left); listEqmInfo.Columns.Add("更新时间", 200, HorizontalAlignment.Left); }
private void SetListBox(List <Werkbon> dayList) { if (werkbonList.InvokeRequired) { try { SetListBoxCallBack d = new SetListBoxCallBack(SetListBox); this.Invoke(d, new object[] { dayList }); } catch (Exception e) { } } else { werkbonList.DataSource = dayList; } }
private void SetListBox(List<Werkbon> dayList) { if (werkbonList.InvokeRequired) { try { SetListBoxCallBack d = new SetListBoxCallBack(SetListBox); this.Invoke(d, new object[] { dayList }); } catch (Exception e) { } } else werkbonList.DataSource = dayList; }
//private SyncServer iocp = new SyncServer(2000, 1024); // private AsyncServer iocp = new AsyncServer(2000, 1024); public MainForm() { InitializeComponent(); setlistboxcallback = new SetListBoxCallBack(SetListBox); }
//private SyncServer iocp = new SyncServer(2000, 1024); // private AsyncServer iocp = new AsyncServer(2000, 1024); public MainForm() { InitializeComponent(); setlistboxcallback = new SetListBoxCallBack(SetListBox); }