Exemplo n.º 1
0
        private void DisplayErrors()
        {
            var appModel  = DataContext as TraceLab.UI.WPF.ViewModels.ApplicationViewModelWrapper;
            var viewModel = appModel.WorkspaceViewModel;

            if (viewModel != null && viewModel.TypeDefinitionErrors != null && viewModel.TypeDefinitionErrors.FirstOrDefault() != null)
            {
                var errors = new List <string>(viewModel.TypeDefinitionErrors);
                viewModel.ClearLoadErrors();
                Window errorWindow  = new Window();
                var    errorControl = new ComponentLibraryErrorDisplay();
                errorWindow.Content               = errorControl;
                errorControl.HeaderText           = "Errors encountered while loading component definitions: ";
                errorControl.Errors               = errors;
                errorWindow.Height                = 500;
                errorWindow.Width                 = 800;
                errorWindow.Owner                 = this.GetParent <MainWindow>(null);
                errorWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                errorWindow.Title                 = "Definition Load Errors";
                errorWindow.ShowDialog();
            }
        }
 private void DisplayErrors()
 {
     var appModel = DataContext as TraceLab.UI.WPF.ViewModels.ApplicationViewModelWrapper;
     var viewModel = appModel.WorkspaceViewModel;
     if (viewModel != null && viewModel.TypeDefinitionErrors != null && viewModel.TypeDefinitionErrors.FirstOrDefault() != null)
     {
         var errors = new List<string>(viewModel.TypeDefinitionErrors);
         viewModel.ClearLoadErrors();
         Window errorWindow = new Window();
         var errorControl = new ComponentLibraryErrorDisplay();
         errorWindow.Content = errorControl;
         errorControl.HeaderText = "Errors encountered while loading component definitions: ";
         errorControl.Errors = errors;
         errorWindow.Height = 500;
         errorWindow.Width = 800;
         errorWindow.Owner = this.GetParent<MainWindow>(null);
         errorWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
         errorWindow.Title = "Definition Load Errors";
         errorWindow.ShowDialog();
     }
 }
 private static void DisplayCopyErrorsWindow(TraceLab.Core.Exceptions.FilesCopyFailuresException ex)
 {
     Window errorWindow = new Window();
     var errorControl = new ComponentLibraryErrorDisplay();
     errorWindow.Content = errorControl;
     errorControl.HeaderText = "Some referenced files failed to be copied: ";
     errorControl.Errors = ex.CopyErrors;
     errorWindow.Height = 500;
     errorWindow.Width = 800;
     foreach (System.Windows.Window window in System.Windows.Application.Current.Windows)
     {
         if (window.IsKeyboardFocusWithin)
         {
             errorWindow.Owner = window;
         }
     }
     errorWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
     errorWindow.Title = "Referenced Files Copy Errors";
     errorWindow.ShowDialog();
 }