aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/Properties/Settings.Designer.cs
blob: fb153fa4c179b71362ea8717b30710e02f6241ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Tango.Core.Commands;
using Tango.MachineStudio.UI.ViewModels;

namespace Tango.MachineStudio.UI.Windows
{
    /// <summary>
    /// Interaction logic for ExceptionWindow.xaml
    /// </summary>
    public partial class ExceptionWindow : Window
    {
        public ExceptionResolutions Resolution { get; set; }

        public String Exception { get; set; }

        public RelayCommand<ExceptionResolutions> ResolveCommand { get; set; }

        public ExceptionWindow()
        {
            InitializeComponent();
            DataContext = this;
        }

        public ExceptionWindow(Exception ex, bool canReport) : this()
        {
            Exception = ex.FlattenException();
            ResolveCommand = new RelayCommand<ExceptionResolutions>(Resolve);

            if (!canReport)
            {
                btnReport.Visibility = Visibility.Collapsed;
            }
        }

        private void Resolve(ExceptionResolutions resolution)
        {
            Resolution = resolution;
            Close();
        }
    }
}