public disTime(Object parent,Object item) { mw = parent as MainWindow; desItem = item as System.Windows.Controls.TextBlock; bindItem(); initTimer(); }
public selectHost(object parent) { InitializeComponent(); mW = parent as MainWindow; initWL(); initDis(); }
public HEXWindow(MainWindow mw,socket socket) { InitializeComponent(); this.mw = mw; this.socket = socket; uiAnimation.translation(this, warningLine0); uiAnimation.translation(this, warningLine1); }
public DebugWindow(MainWindow mw) { this.mw = mw; InitializeComponent(); uiAnimation.translation(this, warningLine0); uiAnimation.translation(this, warningLine1); //mw.Debug_Event += new MainWindow.Debug_Event_Handler(debug); //mw.ipscan.Debug_Event += new ipScan.Debug_Event_Handler(debug); }
//委托的声明 //public delegate void socket_Event_Handler(byte[] data); //用委托声明两个事件 //public event socket_Event_Handler socket_sended_Event; //public event socket_Event_Handler socket_received_Event; public socket(MainWindow mw ,String ipAddress) { this.mw = mw; ip = ipAddress; sendBuffer = new byte[1024];//Send buffer //c# automatic assigesd to 0 try { //创建一个Socket serviceSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); System.Threading.Thread tt = new System.Threading.Thread(delegate() { //连接到指定服务器的指定端口 //方法参考:http://msdn.microsoft.com/zh-cn/library/system.net.sockets.socket.connect.aspx try { serviceSocket.Connect(ip, port); initreceive(1); } catch(Exception ee) { //MessageBox.Show(ee.Message + "\r\n From: socket.socket(String ipAddress).thread"); lock (mw.dw.debugBox) mw.dw.debugBox.Dispatcher.Invoke(new Action(delegate() { mw.dw.debugBox.AppendText(ee.Message + "\r\n From: socket.socket(String ipAddress).thread" + "\r\n"); })); } }); tt.IsBackground = true; tt.Start(); } catch (Exception e) { //MessageBox.Show(e.Message + "\r\n From: socket.socket(String ipAddress)"); lock (mw.dw.debugBox) mw.dw.debugBox.AppendText(e.Message + "\r\n From: socket.socket(String ipAddress)" + "\r\n"); } }
//public delegate void Debug_Event_Handler(object sender, String msg); //public event Debug_Event_Handler Debug_Event; public ipScan(Object mw) { this.mw = mw as MainWindow; //this.mw.iplistView.ItemsSource = mw.personalInfoList; ipScanProceed(); }