public void Start(object sender, RoutedEventArgs e) { Button button = (Button)sender; try { server = new ETServer(Convert.ToByte(IdBox.Text), TrackerType.Text, Dispatcher); Properties.Settings.Default.ID = Convert.ToByte(IdBox.Text); Properties.Settings.Default.TrackerType = TrackerType.Text; Properties.Settings.Default.Save(); } catch (Exception exc) { MessageBox.Show(exc.Message); return; } InActive = false; th = new Thread(server.Start); ClickSwap(button, Start, Stop); ConnectionList.DataContext = server; try { th.Start(); } catch (Exception exc) { MessageBox.Show(exc.Message, "Error Occured", MessageBoxButton.OK, MessageBoxImage.Error); Stop(sender, new RoutedEventArgs()); } }
public static void Main() { ETServer server = new ETServer(); server.Start(); server.shutdown.WaitOne(); server.Dispose(); }
public ServerGUI() { th = null; server = null; Closing += Stop; InActive = true; InitializeComponent(); this.DataContext = this; IdBox.Text = Eriver.GUIServer.Properties.Settings.Default.ID.ToString(); TrackerType.SelectedItem = Properties.Settings.Default.TrackerType; }