Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 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.");
 }
Esempio n. 3
0
        public MainWindow()
        {
            GlobalInformation.ReadConfigFile();
            InitializeComponent();

            _controller          = new MainWindowViewModel();
            this.DataContext     = _controller;
            Searchbar.Foreground = Brushes.DimGray;
            Searchbar.Text       = "Search picture";
            Searchbar.FontSize   = 14;
        }
Esempio n. 4
0
 public BusinessLayer()
 {
     _dataAccessLayer = new DataAccessLayer();
     GlobalInformation.ReadConfigFile();
     _pathFolder = GlobalInformation.Path;
 }
Esempio n. 5
0
 public void ut_configfile_picturepath()
 {
     GlobalInformation.ReadConfigFile();
     Assert.IsNotNull(GlobalInformation.Path);
 }
Esempio n. 6
0
 public void ut_configfile_dbconnection()
 {
     GlobalInformation.ReadConfigFile();
     Assert.IsNotNull(GlobalInformation.ConnectionString);
 }