I have a program with two modes: GUI and Just Run. The GUI downloads the WPF form and allows me to configure the settings, while Just Run loads the specified settings and just ... well ... it works.
This is an illustrious, customizable tool for batch file transfers.
Problem: The Journal does not end. It seems to be still recording while the program is closing, thereby cutting off the end of the log.
Main application:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
if (!e.Args.Contains("-gui"))
{
Process.SettingsPopulate();
Process.WriteLogHead();
Process.MoveFiles();
Process.WriteLogEnd();
}
else
{
new MainWindow().ShowDialog();
}
this.Shutdown();
}
}
Real simple. If the command line has -gui, it loads WPF ... otherwise it just starts.
public static void WriteLogEnd()
{
foreach (var log in from i in Items
where i.Used == false
let build = new StringBuilder()
select build.AppendFormat("{0, -12} > {1} > Not Found", _time, i.FileName))
{
Logs(log);
}
Logs("");
Logs("Fin.");
}
- "Write to Console, Write to file". , , ... aka "not found". Fin, .
. , WriteLogEnd ( afaik, ).