public Window1() { InitializeComponent(); TransformGroup group = new TransformGroup(); TranslateTransform tt = new TranslateTransform(); group.Children.Add(tt); image1.RenderTransform = group; TransformGroup group2 = new TransformGroup(); TranslateTransform tt2 = new TranslateTransform(); group2.Children.Add(tt2); image2.RenderTransform = group2; contactDataController = EmulatorContactDataController.Instance; Point p1 = new Point(12, 39); ContactDescriptor c1 = new ContactDescriptor(iPhoneID,(int) p1.X,(int) p1.Y, 180.0f); contactDataController.addContact(iPhoneID, c1); Point p2 = new Point(245, 190); ContactDescriptor c2 = new ContactDescriptor(iPadID, (int)p2.X, (int)p2.Y, 180.0f); contactDataController.addContact(iPadID, c2); //serverController = new ServerController(5); //Thread oThread = new Thread(new ThreadStart(serverController.startServer)); SeverThread fetcher = new SeverThread(this.runServer); //oThread.Start(); fetcher.BeginInvoke(null, null); }
private EmulatorServerController() { IPEndPoint e = new IPEndPoint(IPAddress.Any, udpPort); uClient = new UdpClient(udpPort); cDataController = EmulatorContactDataController.Instance; UdpState s = new UdpState(); s.e = e; s.u = uClient; uClient.BeginReceive(new AsyncCallback(onRecevice), s); }