mirror of
https://github.com/chylex/Code-Statistics.git
synced 2025-07-29 22:59:09 +02:00
Work on template debugging (fix variables, thread exception, tweak UI)
This commit is contained in:
parent
f097a070a1
commit
f7ee507658
CodeStatistics
@ -28,6 +28,7 @@ namespace CodeStatistics.Data{
|
||||
{ "LoadProjectSearchIO", "Searching Files and Folders..." },
|
||||
{ "LoadProjectProcess", "Processing the Project..." },
|
||||
{ "LoadProjectProcessingDone", "Project processing finished." },
|
||||
{ "LoadProjectDummyDebugTemplate", "Debugging template..." },
|
||||
{ "LoadProjectProcessingFiles", "$1 / $2" },
|
||||
{ "LoadProjectCancel", "Cancel" },
|
||||
{ "LoadProjectClose", "Close" },
|
||||
|
@ -72,7 +72,7 @@ namespace CodeStatistics.Forms{
|
||||
});
|
||||
|
||||
project.Finish += vars => this.InvokeOnUIThread(() => {
|
||||
variables = vars;
|
||||
variables = Program.Config.IsDebuggingTemplate ? new Variables.Dummy() : vars;
|
||||
|
||||
labelLoadInfo.Text = Lang.Get["LoadProjectProcessingDone"];
|
||||
|
||||
@ -97,20 +97,19 @@ namespace CodeStatistics.Forms{
|
||||
}
|
||||
|
||||
if (Program.Config.IsDebuggingTemplate){
|
||||
string templatePath = Program.Config.GetCustomTemplateFilePath();
|
||||
if (templatePath == null)return; // WTF
|
||||
string templateFile = Program.Config.GetCustomTemplateFilePath();
|
||||
if (templateFile == null)return; // WTF
|
||||
|
||||
FileSystemWatcher watcher = new FileSystemWatcher{
|
||||
Path = templatePath,
|
||||
NotifyFilter = NotifyFilters.LastWrite,
|
||||
Filter = Path.GetFileName(templatePath)
|
||||
};
|
||||
|
||||
watcher.Changed += (sender, args) => {
|
||||
GenerateOutputFile(variables);
|
||||
Path = Path.GetDirectoryName(templateFile),
|
||||
Filter = Path.GetFileName(templateFile),
|
||||
NotifyFilter = NotifyFilters.LastWrite
|
||||
};
|
||||
|
||||
watcher.Changed += (sender, args) => GenerateOutputFile(variables);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
labelLoadData.Text = Lang.Get["LoadProjectDummyDebugTemplate"];
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user