private void MenuOptionChangeHomeFolder_Click(object sender, RoutedEventArgs e) { FolderBrowserDialog fbd = new FolderBrowserDialog(); fbd.SelectedPath = GlobalInformation.Path; fbd.ShowDialog(); //if the path changed, overwrite config file and load pictures of the new folder if (fbd.SelectedPath != GlobalInformation.Path) { var oldLines = System.IO.File.ReadAllLines("config.txt"); List <string> newLines = new List <string>(); foreach (var line in oldLines) { if (line.Contains("path,")) { string addLine = "path," + fbd.SelectedPath + "\\"; newLines.Add(addLine); } else { newLines.Add(line); } } System.IO.File.WriteAllLines("config.txt", newLines); GlobalInformation.ReadConfigFile(); ((PictureListViewModel)_controller.List).SyncAndUpdatePictureList(); } }
public MainWindow() { GlobalInformation.ReadConfigFile(); // Save information from the config file _controller = new MainWindowViewModel(); InitializeComponent(); this.DataContext = _controller; Searchbar.Foreground = Brushes.DimGray; Searchbar.Text = "Search picture"; log.Debug("Applikation erfolgreich gestartet."); }
public MainWindow() { GlobalInformation.ReadConfigFile(); InitializeComponent(); _controller = new MainWindowViewModel(); this.DataContext = _controller; Searchbar.Foreground = Brushes.DimGray; Searchbar.Text = "Search picture"; Searchbar.FontSize = 14; }
public BusinessLayer() { _dataAccessLayer = new DataAccessLayer(); GlobalInformation.ReadConfigFile(); _pathFolder = GlobalInformation.Path; }
public void ut_configfile_picturepath() { GlobalInformation.ReadConfigFile(); Assert.IsNotNull(GlobalInformation.Path); }
public void ut_configfile_dbconnection() { GlobalInformation.ReadConfigFile(); Assert.IsNotNull(GlobalInformation.ConnectionString); }