private void Window_ContentRendered(object sender, EventArgs e) { if (ScriptsBuilder.ReloadScripts()) { // Sucess: this.progresslbl.Content = "Loading..."; System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Interval = 5; timer.Tick += timer_Tick; timer.Enabled = true; Result = true; } else { progressBar.Value = 80; this.progresslbl.Content = "Failure!"; Result = false; EditorCommands.ShowOutputMessage("Error while compiling the scripts"); ErrorDataGrid.Visibility = Visibility.Visible; ErrorDataGrid.ItemsSource = ScriptsBuilder.Logger.Errors; } }
private void Compile() { this.Dispatcher.Invoke((Action)(() => { if (!ScriptsBuilder.ReloadScripts()) { ErrorDataGrid.ItemsSource = ScriptsBuilder.Logger.Errors; if (ErrorDataGrid.Items.Count > 0) { ErrorsExpander.IsExpanded = true; } } else { ErrorDataGrid.ItemsSource = null; EditorCommands.CreatePropertyGridView(); } })); }