mirror of
https://github.com/chylex/Code-Statistics.git
synced 2025-07-26 22:59:07 +02:00
Work on behavior (program arguments, missing lang keys)
This commit is contained in:
parent
137cc20a40
commit
77e3b32240
CodeStatistics
@ -25,6 +25,7 @@ namespace CodeStatistics.Data{
|
||||
{ "LoadProjectSearchIO", "Searching Files and Folders..." },
|
||||
{ "LoadProjectProcess", "Processing the Project..." },
|
||||
{ "LoadProjectProcessingDone", "Project processing finished." },
|
||||
{ "LoadProjectProcessingFiles", "$1 / $2" },
|
||||
{ "LoadProjectCancel", "Cancel" },
|
||||
{ "LoadProjectClose", "Close" },
|
||||
{ "LoadProjectGenerate", "Generate HTML" },
|
||||
|
@ -58,7 +58,7 @@ namespace CodeStatistics.Forms{
|
||||
|
||||
project.Progress += (percentage, processedEntries, totalEntries) => this.InvokeOnUIThread(() => {
|
||||
UpdateProgress(ProgressBarStyle.Continuous,percentage);
|
||||
labelLoadData.Text = processedEntries+" / "+totalEntries;
|
||||
labelLoadData.Text = Lang.Get["LoadProjectProcessingFiles",processedEntries,totalEntries];
|
||||
});
|
||||
|
||||
project.Finish += vars => this.InvokeOnUIThread(() => {
|
||||
@ -74,6 +74,15 @@ namespace CodeStatistics.Forms{
|
||||
btnDebugProject.Visible = true;
|
||||
btnBreakPoint.Visible = true;
|
||||
#endif
|
||||
|
||||
if (Program.Config.AutoOpenBrowser){
|
||||
btnGenerateOutput_Click(null,new EventArgs());
|
||||
}
|
||||
|
||||
if (Program.Config.CloseOnFinish){
|
||||
DialogResult = DialogResult.Abort;
|
||||
Close();
|
||||
}
|
||||
});
|
||||
|
||||
project.ProcessAsync();
|
||||
|
@ -13,11 +13,6 @@ namespace CodeStatistics{
|
||||
static void Main(string[] args){
|
||||
Application.EnableVisualStyles();
|
||||
|
||||
AppDomain.CurrentDomain.FirstChanceException += (sender, ex) => {
|
||||
if (ex.Exception is EntryPointNotFoundException)return;
|
||||
System.Diagnostics.Debug.WriteLine("OOPS - Breakpoint");
|
||||
};
|
||||
|
||||
ProgramArguments programArgs = new ProgramArguments(args,ProgramConfiguration.Validate);
|
||||
|
||||
if (programArgs.HasError){
|
||||
@ -31,12 +26,8 @@ namespace CodeStatistics{
|
||||
MainForm form = new MainForm();
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK){
|
||||
ProjectLoadForm loadForm = new ProjectLoadForm(form.InputMethod);
|
||||
|
||||
DialogResult result = loadForm.ShowDialog();
|
||||
if (result == DialogResult.Cancel)continue;
|
||||
|
||||
// TODO
|
||||
DialogResult result = new ProjectLoadForm(form.InputMethod).ShowDialog();
|
||||
if (result == DialogResult.Abort)break;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ namespace CodeStatistics{
|
||||
switch(argument.Name){
|
||||
case "nogui":
|
||||
case "openbrowser":
|
||||
case "autoclose":
|
||||
case "in:dummy":
|
||||
return true;
|
||||
|
||||
@ -39,9 +40,15 @@ namespace CodeStatistics{
|
||||
|
||||
private readonly string outputFile, templateFile;
|
||||
|
||||
public readonly bool AutoOpenBrowser;
|
||||
public readonly bool CloseOnFinish;
|
||||
|
||||
public ProgramConfiguration(ProgramArguments args){
|
||||
outputFile = args.HasVariable("out") ? args.GetVariable("out") : null;
|
||||
templateFile = args.HasVariable("template") ? args.GetVariable("template") : null;
|
||||
|
||||
AutoOpenBrowser = args.CheckFlag("openbrowser");
|
||||
CloseOnFinish = args.CheckFlag("autoclose");
|
||||
}
|
||||
|
||||
public string GetOutputFilePath(){
|
||||
|
Loading…
Reference in New Issue
Block a user