Fixed stuff

This commit is contained in:
Norbi Peti 2016-04-19 22:33:08 +02:00
parent bfafff210c
commit fdb8440f68
2 changed files with 39 additions and 5 deletions

View file

@ -144,10 +144,39 @@ namespace DEIFR
File.Delete(file); File.Delete(file);
} }
} }
if (Program.Auto)
{
Stop = true;
Program.Form.Invoke(new Action(delegate
{
Program.Form.Close();
}));
return true;
}
Finished = true;
} }
return true; return true;
} }
public static bool Stop { get; set; } private static bool stop = false;
public static bool Stop
{
get
{
return stop;
}
set
{
stop = value;
if (Finished)
{
Program.Form.Invoke(new Action(delegate
{
Program.Form.Close();
}));
}
}
}
private static bool Finished = false;
} }
} }

View file

@ -14,6 +14,7 @@ namespace DEIFR
public static ProgressBar Progress; public static ProgressBar Progress;
public static Form1 Form; public static Form1 Form;
public static ProgressBar AllProgress; public static ProgressBar AllProgress;
public static bool Auto = false;
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
@ -49,10 +50,14 @@ namespace DEIFR
} }
else else
MaxImages = 50; MaxImages = 50;
if (args.Length == 0) if (args.Length > 0)
Application.Run(Form = new Form1()); {
else if (args[0].ToLower() != "silent") if (args[0].ToLower() != "silent")
Console.WriteLine("Error: Unknown parameter(s). Use \"silent\" to open in background, otherwise don't give any parameters to show settings."); Console.WriteLine("Error: Unknown parameter(s). Use \"silent\" to open in background, otherwise don't give any parameters to show settings.");
else
Auto = true;
}
Application.Run(Form = new Form1());
List<string> sw = new List<string>(); List<string> sw = new List<string>();
sw.Add("maximages=" + MaxImages); sw.Add("maximages=" + MaxImages);
sw.Add("keepimages=" + KeepImages); sw.Add("keepimages=" + KeepImages);