View Full Version : Serial Port Setup Dialog
teberle
10-08-2007, 12:27 PM
All,
Instead of creating your own serial port setup dialog you can use the Vixen.Dialogs.SerialSetupDialog class. Just add a button, a click event and then instantiate the dialog. You can then get the serial port object buy calling the selectedPort accessor method. I am using this in a new plugin I am writing.
There are also several other dialogs available in the namespace Vixen.Dialogs.
Tony
A Marchini
10-08-2007, 12:50 PM
All,
Instead of creating your own serial port setup dialog you can use the Vixen.Dialogs.SerialSetupDialog class. Just add a button, a click event and then instantiate the dialog. You can then get the serial port object buy calling the selectedPort accessor method. I am using this in a new plugin I am writing.
There are also several other dialogs available in the namespace Vixen.Dialogs.
Tony
Just out of curiousity, this dialog is capable of full enumeration of serial ports. It won't just do COM1-COM4... right?
Tony M.
teberle
10-11-2007, 02:38 PM
It stops at 99. That should be enough.
flowblok
10-11-2007, 04:41 PM
Er - does it do what I did for my Serial plugins - get the active serial ports, and show only them? Because we're working with .Net, a CLI system, there is always the possibility that Vixen may become cross-platform at one point, so choosing the serial port from the .Net classes is better than just giving COM1, COM2, ... COM99.
I haven't taken a look yet (too busy with my lovely linux distro, Debian), but I'm going to take a look at it later once I've moved my development stuff across computers.
The relevant code is:
// Initialise the variable.
string[] AvaliablePorts;
// Get the avaliable ports.
AvaliablePorts = SerialPort.GetPortNames();
No, it doesn't do that, but thanks for the code.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.