public Manual(Coder coder) { this.coder = coder; InitializeComponent(); activated = false; short value = (short)(Speed.Value * 10); SpeedBox.Text = value.ToString(); value = (short)(Turning_Speed.Value * 10); TurningSpeedBox.Text = value.ToString(); }
public virtual void Start(Coder coder) { this.coder = coder; ThreadStart ts = new ThreadStart(this.Receive); receive = new Thread(ts); ThreadStart ts2 = new ThreadStart(this.ReSend); reSend = new Thread(ts2); end = false; port.Open(); receive.Start(); reSend.Start(); }
public MainWindow() { try { coder = new Coder(); coder.Start(this); } catch (Exception e) { MessageBoxResult mbres = MessageBox.Show( "Could not initialize the coder. Original message: " + e.Message + " Do you want to continue anyway?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Exclamation); if (mbres == MessageBoxResult.No) { Application.Current.Shutdown(); } } InitializeComponent(); }