private void FileCreateConfigMenuItem_Click(object sender, RoutedEventArgs e)
 {
     var service = new ConfigService();
     var model = service.CreateConfig();
     DataContext = model;
     //EditConfig(model.Configs[0]);
 }
        private void FileOpenConfigMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new System.Windows.Forms.OpenFileDialog();
            dlg.CheckFileExists = true;
            dlg.DefaultExt = ".config";
            dlg.Filter = "HyperActive Confg Files | *.config";
            dlg.Title = "Select HyperActive Configuration File";

            if (System.Windows.Forms.DialogResult.OK != dlg.ShowDialog()) return;
            var service = new ConfigService();
            string configFilePath = dlg.FileName;
            var model = service.EditConfigs(configFilePath);
            DataContext = model;
            //EditConfig(model.Configs[0]);
        }
 void AppStartWindow_Loaded(object sender, RoutedEventArgs e)
 {
     if (DataContext == null)
     {
         var projectWin = new ProjectWindow();
         projectWin.Owner = this;
         projectWin.ShowDialog();
         if (projectWin.Model != null)
         {
             var service = new ConfigService();
             EditConfigsViewModel model = service.EditConfigs(projectWin.Model);
             DataContext = model;
             ConfigsListBox.SelectedIndex = 0;
         }
     }
 }
 private void FileSaveConfigMenuItem_Click(object sender, RoutedEventArgs e)
 {
     var service = new ConfigService();
     EditConfigsViewModel model = DataContext as EditConfigsViewModel;
     if (String.IsNullOrEmpty(model.ConfigFilePath))
     {
         var dlg = new System.Windows.Forms.SaveFileDialog();
         dlg.FileName = "hyperactive.config";
         dlg.CheckFileExists = false;
         dlg.Title = "Select HyperActive Configuration File";
         dlg.DefaultExt = ".config";
         dlg.Filter = "Config Files | *.config";
         if (System.Windows.Forms.DialogResult.OK == dlg.ShowDialog())
         {
             model.ConfigFilePath = dlg.FileName;
         }
     }
     service.Save(model);
     Status("Saved " + model.ConfigFilePath + " at " + DateTime.Now.ToString("MMM d, yyyy hh:mm:ss"));
 }