C # Creating an interface for the console?

I wrote a console program in C # that takes up to three files as input and does some data computation on them.

I would like to make a simple interface that allows the user to easily

* import files - basically select up to three files to be redirected to the backend code

* change settings - I have about 10 settings which I currently store in my app.config file. maybe a simple settings panel would be nice

* see what's going on - the console program shows some status messages that might be useful to display in the GUI

I have almost no experience with window forms or gui design, so I really don't know where to start. I have compiled the backend to * .dll and am currently playing in sharpdevelop design mode ... but I really don't know how to make them work together.

any pointers would be greatly appreciated!

0


a source to share


4 answers


If you want to get started with a GUI in .NET, I recommend you choose WPF (Windows Presentation Foundation). These are the latest technologies released in the user interface / graphics area of ​​Microsoft and things are now going down that path. (Windows Forms won't be obsolete for a long time, although of course it is gradually becoming obsolete.) However, I noticed that you are using SharpDevelop, which does not have real WPF support yet (as far as I know) whereas for WinForms this is of course. If you are able to use Visual Studio, I recommend that you start by learning WPF. You have the advantage of not being confused with previous experience with WinForms styles and methodologies, so this will be a very good path.

Whatever you want to know, the Getting Started page WindowsClient.NET (MS official site for WinForms and WPF) would be a great resource. Also, several MSDN article articles start with WPF.



Hope it helps.

+1


a source


A common pattern in such cases is to make the main functionality of the application in a class library and call it from a wrapping executable such as a console application, a winforms application, or a webforms application (if possible). This way, you can easily adapt the interface as needed and just inject and output the route into and out of the class library.



Edit: I realize this isn't a very deep answer, but I hope it helps get started at least along with any other answer that may come along.

+3


a source


Have you tried the Visual Studio Express editions? They are free and come with a designer for WinForms or WPF applications.

As a first pass, you will need 3 text areas for file names, with corresponding buttons to open the file open dialog (it doesn't actually open the file, just returns the file name).

Status Display Label - Updated from your working code.

Then either various radio buttons, checkboxes, etc. for your config settings.

Oh, and don't forget the Start button to customize the process.

If your process takes a while, you should use a background worker thread. You can then use the Cancel button to safely abort the process and tidy up if it goes wrong.

There will be optimizations and reorganizations that you can do when you have work to do.

0


a source


Your question is pretty fuzzy. If you are asking about working with a GUI, you should read some book on Windows Forms. And if you are asking about how to put your dll in a new windows forms application, then you should just add a reference to it in the properties of the winforms project and then use the classes from the dll namespace.

0


a source







All Articles