public static void Main(string[] args) { Application.Init (); MainWindow win = new MainWindow (); win.Show (); Application.Run (); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Main = ((Server.MainWindow)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.wMain = ((Server.MainWindow)(target)); return; case 2: this.sbMain = ((System.Windows.Controls.Primitives.StatusBar)(target)); return; case 3: this.lbActiveClients = ((System.Windows.Controls.ListBox)(target)); return; case 4: this.gControl = ((System.Windows.Controls.Grid)(target)); return; case 5: this.bSwitchServerState = ((System.Windows.Controls.Button)(target)); #line 71 "..\..\MainWindow.xaml" this.bSwitchServerState.Click += new System.Windows.RoutedEventHandler(this.bSwitchServerState_Click); #line default #line hidden return; case 6: this.tbTargetUsername = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.tbMessage = ((System.Windows.Controls.TextBox)(target)); return; case 8: this.bSend = ((System.Windows.Controls.Button)(target)); #line 91 "..\..\MainWindow.xaml" this.bSend.Click += new System.Windows.RoutedEventHandler(this.bSend_Click); #line default #line hidden return; case 9: this.lstChatHistory = ((System.Windows.Controls.ListBox)(target)); return; } this._contentLoaded = true; }
public MyServer(int port, string username, string password, MainWindow w) { try { exch = new ECDiffieHellmanCng(256); exch.KeyDerivationFunction = ECDiffieHellmanKeyDerivationFunction.Hash; exch.HashAlgorithm = CngAlgorithm.Sha256; publicKey = exch.PublicKey.ToByteArray(); this.username = username; this.password = password; this.Window = w; input = new Input(); mcb = new MyClipBoard(); localpt = new IPEndPoint(IPAddress.Any, port); /* Initializes the Listener */ myList = new TcpListener(localpt); uclient = new UdpClient(); uclient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); uclient.DontFragment = true; uclient.Client.Bind(localpt); /* Start Listening at the specified port */ myList.Start(); Console.WriteLine("The server is running at port 8001..."); Console.WriteLine("The local End point is :" + myList.LocalEndpoint); Console.WriteLine("Waiting for a connection....."); Thread t3 = new Thread(InputProcessing); t3.Start(); Thread t = new Thread(ClipBoardProcessing); //LOGIN AND CLIPBOARD PROCESSING t.SetApartmentState(ApartmentState.STA); t.Start(); } catch (SocketException se) { if (se.ErrorCode == 10048) { throw se; } Console.WriteLine(se.Message + " " + se.ErrorCode); } catch (Exception e) { Console.WriteLine(e.Message); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.mainWindow = ((Server.MainWindow)(target)); return; case 2: this.portBox = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.chatInfo = ((System.Windows.Controls.RichTextBox)(target)); return; case 4: this.startButton = ((System.Windows.Controls.Button)(target)); #line 27 "..\..\MainWindow.xaml" this.startButton.Click += new System.Windows.RoutedEventHandler(this.startClick); #line default #line hidden return; case 5: this.finishButton = ((System.Windows.Controls.Button)(target)); #line 28 "..\..\MainWindow.xaml" this.finishButton.Click += new System.Windows.RoutedEventHandler(this.finishClick); #line default #line hidden return; } this._contentLoaded = true; }
public PhysicsManager(MainWindow server) { this.server = server; toUpdate = new Queue<WorldPosition>(); HelpfulStuff.RunPeriodic(doWork, 200); }
public void addMess(string mes) { List_mess.Items.Add(mes); MainWindow.UpdateScrollBar(List_mess); }
public MainWindow() { InitializeComponent(); instance = this; }
public Service(MainWindow host) { this.host = host; HelpfulStuff.RunPeriodic(SendSettings, 1000); }