25 using System.Windows.Forms;
30 namespace Ntp.Analyzer.Validate.Gui
36 InitializeComponent();
44 if (openFileDialog.ShowDialog() != DialogResult.OK)
47 file = openFileDialog.FileName;
48 textBoxFile.Text = file;
49 textBoxOutput.Clear();
50 ValidateConfiguration();
55 ValidateConfiguration();
60 ValidateConfiguration();
65 ValidateConfiguration();
70 if (!File.Exists(configFile))
72 textBoxOutput.Text = $
"Cannot find configuration file {configFile}";
77 var config = reader.Execute();
81 textBoxOutput.Lines = reader.Errors.ToArray();
87 if (
string.IsNullOrEmpty(file))
90 textBoxOutput.Clear();
95 config = LoadConfig(file);
99 textBoxOutput.Text =
@"Unexpected error while loading configuration file: " + e.Message;
106 if (checkBoxValidate.Checked)
108 textBoxOutput.Text =
@"Configuration is valid.";
117 IndentChar = checkBoxTabulator.Checked ?
'\t' :
' ',
118 IndentSize = checkBoxTabulator.Checked ? 1 : 8,
119 ShowDefaultValues = checkBoxDefaultValues.Checked
122 textBoxOutput.Text = decompiler.Execute();
126 textBoxOutput.Text =
@"Unexpected error while decompiling configuration: " + e.Message;