I'm writing a little utility which has a WPF based interface. I also want to be able to automate the same tasks performed by the utility by executing a program with command line parameters. Is it a bad idea to combine both of these tasks into one program? I have the actual logic and functionality that my tool performs in a separate shared library. So I wouldn't be duplicating a whole lot of code if they were separate.
I was thinking of doing something like this in my App.cs file
private void Application_Startup(object sender, StartupEventArgs e)
{
if (e.Args.Length > 1)
{
//Go do automated tasks
}
else
{
//open GUI
Window window = new Window();
this.MainWindow = window;
window.Show();
}
}