Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var simForm = new SimulatorForm();

            Application.Run(simForm);
        }
Example #2
0
        public void Connect(SimulatorForm sm)
        {
            _comPort = new SerialPort
            {
                PortName = "COM1",
                BaudRate = 4800,
                DataBits = 8,
                Parity   = Parity.None,
                StopBits = StopBits.One
            };

            try
            {
                _comPort.Open();
                _simForm = sm;
            }
            catch (Exception)
            {
                _comPort = null;
            }
        }