Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            Closing += (sender, e) => Save();

            DataContext = this;

            Closing += MainWindow_Closing;

            if (!File.Exists(configFileName))
            {
                var cfg = new BatchInspectorConfig {
                    InspectionSchemaFileName = "InspectionSchema.xaml"
                };
                for (int i = 0; i < 10; i++)
                {
                    cfg.Directories.Add(new DirectoryViewModel());
                }
                cfg.SerializeToXamlFile(configFileName);
            }

            Load();

            _inspectionController = new InspectionController();
        }
Example #2
0
        private void Save()
        {
            var c = new BatchInspectorConfig();

            c.Directories.AddRange(Directories);
            c.InspectionSchemaFileName = InspectionSchemaTextBox.Text;
            c.InspectionReportFileName = InspectionReportTextBox.Text;

            c.SerializeToXamlFile(configFileName);
        }