コード例 #1
0
        public frmSimulator(SerialWriter serialWriter)
        {
            InitializeComponent();
            KeyPreview = true;

            controller1.SerialWriter = serialWriter;
            controller1.InitKeyMapDictionary(ControllerIndex.First);
            controller1.OnCustomize += ControllerN_OnCustomize;

            controller2.SerialWriter = serialWriter;
            controller2.InitKeyMapDictionary(ControllerIndex.Second);
            controller2.OnCustomize += ControllerN_OnCustomize;
        }
コード例 #2
0
 private void StartSimulator()
 {
     try
     {
         using (SerialWriter writer = new SerialWriter(GetSelectedPort()))
             using (frmSimulator sim = new frmSimulator(writer))
             {
                 this.Hide();
                 sim.ShowDialog();
             }
     }
     catch (Exception ex) { this.Show(); MessageBox.Show(this, ex.Message); }
     this.Show();
 }