private void btnViewCurrent_Click(object sender, RoutedEventArgs e) { if (!FileOperations.RepoFound(RepoLocation)) { tbNotifications.Background = new SolidColorBrush(Colors.Red); tbNotifications.Foreground = new SolidColorBrush(Colors.White); tbNotifications.Text = "DeviceConfig_DISPENSER.ini not found! Please verify your repository location and try again."; return; } UtilityMethods.RunTextEditor(); }
public void PopulateComboBox() { if (FileOperations.RepoFound(Window.RepoLocation)) { Window.FileList = FileOperations.GetFileList(Window.RepoLocation + "AcceptanceTests\\CommonData\\IniFilesForAAT\\"); foreach (var t in Window.FileList) { Window.cboFileList.Items.Add(t); } } else { SetRepoNotFoundMessage(); } }
public MainWindow() { InitializeComponent(); FileOperations = new FileOperations(this); UtilityMethods = new UtilityMethods(this, RepositoryLocationEntryWindow); RepoLocation = Properties.Settings.Default.CurrentRepoLocation; if (FileOperations.RepoFound(RepoLocation)) { LastSelected = Properties.Settings.Default.LastSelectedFile; } else { UtilityMethods.SetRepoNotFoundMessage(); } cboFileList.Items.Clear(); UtilityMethods.PopulateComboBox(); if (!string.IsNullOrEmpty(Properties.Settings.Default.LastSelectedFile) && FileOperations.RepoFound(RepoLocation)) { try { var indexOfLastSelected = UtilityMethods.GetIndexOfLastSelected(Properties.Settings.Default.LastSelectedFile); if (indexOfLastSelected != null) { cboFileList.SelectedItem = cboFileList.Items[ (int)indexOfLastSelected]; } tbNotifications.Text = "The last selected backup file was:"; } catch (Exception) { cboFileList.SelectedIndex = -1; tbNotifications.Text = ""; } } }