private void OnArduinoDisconnected(ArduinoChangedEventArgs args)
        {
            // Print console
            ArduinoConsole.AddConsoleText("Arduino disconnected: @nobreak", ConsoleViewModel.TextColors.Magenta);
            ArduinoConsole.AddConsoleText(String.Format("COM-Port \"{0}\" - Name {1}", args.ComPort, args.Name));

            if (ContainsArduino(args.Name))
            {
                ArduinoCollection[GetArduinoIndex(args.Name)].Dispose();
                ArduinoCollection.Remove(ArduinoCollection[GetArduinoIndex(args.Name)]);

                Console.Write(" on COM-Port \"{0}\" with name {1}.", args.ComPort, args.Name);
            }
        }
        private void OnArduinoAvailable(ArduinoChangedEventArgs args)
        {
            // Print console
            ArduinoConsole.AddConsoleText("Arduino connected: @nobreak", ConsoleViewModel.TextColors.Green);
            ArduinoConsole.AddConsoleText(String.Format("COM-Port \"{0}\" - Name {1}", args.ComPort, args.Name));

            try
            {
                ArduinoCollection.Add(new ArduinoViewModel(args.Name, args.ComPort, args.sp, OnMessageRecieved));
            }
            catch (Exception e)
            {
                //PrintError(e.ToString());

                if (ContainsArduino(args.Name))
                {
                    ArduinoCollection.Remove(ArduinoCollection[GetArduinoIndex(args.Name)]);
                }

                //PrintConnectedArduinos();
                return;
            }

            //Task.Factory.StartNew(WaitArduinoReset).Wait();

            if (ContainsArduino(args.Name))
            {
                try
                {
                    ArduinoCollection[GetArduinoIndex(args.Name)].Send("Connection established");
                }
                catch (Exception)
                {
                    //PrintError("Connection established command was not sent");
                    ArduinoCollection[GetArduinoIndex(args.Name)].Dispose();
                }
            }
        }