Ejemplo n.º 1
0
        private void OnActionClicked(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;

            if (button != null)
            {
                if (button.Tag.ToString() == "Connect")
                {
                    m_VridgeSocketReader.Connect();
                }
                else
                {
                    m_VridgeSocketReader.Shutdown();
                }

                ConnectionStatus.Text = m_VridgeSocketReader.IsRunning ? "Connected" : "Not Connected";
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var parameters = ParseCliParameters(ref args);
            var portName   = string.Empty;
            var left       = true;

            if (parameters.ContainsKey(SerialPortName))
            {
                portName = parameters[SerialPortName];
            }

            if (parameters.ContainsKey(LeftHandName))
            {
                left = parameters[LeftHandName] == "True";
            }

            var vridgeSocketReader = new VridgeSocketReader(portName, left);

            vridgeSocketReader.Connect();
            Console.ReadKey();
            vridgeSocketReader.Shutdown();
        }