Пример #1
0
        public ITTF_TrainStationForm()
        {
            InitializeComponent();

            processor = new TrainStationProcessor(ServerLbl);

            try
            {
                string name = Environment.MachineName + "[" + processor.GetMyIP() + "]";

                tbWhoAmI.Text = processor.ConnectMe(ObjectType.Station, name).ToString();

                this.Text += "\"" + name + "\"";
            }
            catch (Exception ex)
            {
                MessageBox.Show("Startup error: ", ex.Message);
                processor.Dispose();
                Application.Exit();
            }

            ControlWriter consoleWriter = new ControlWriter(messagesBox);

            Console.SetOut(consoleWriter);
        }
Пример #2
0
 private void ITTF_TrainStationForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         processor.Dispose();
     }
     catch (Exception)
     {
         //again, we want to shutdown, not crash the shit out of a computer ;)
     }
 }
Пример #3
0
        public ITTF_TrainStationForm()
        {
            InitializeComponent();

            processor = new TrainStationProcessor(ServerLbl);

            try
            {
                string name = Environment.MachineName + "[" + processor.GetMyIP() + "]";

                tbWhoAmI.Text = processor.ConnectMe(ObjectType.Station, name).ToString();

                this.Text += "\"" + name + "\"";
            }
            catch(Exception ex)
            {
                MessageBox.Show("Startup error: ", ex.Message);
                processor.Dispose();
                Application.Exit();
            }

            ControlWriter consoleWriter = new ControlWriter(messagesBox);
            Console.SetOut(consoleWriter);
        }