Ejemplo n.º 1
0
 public SettingsViewModel(LanguageDatabase languageDatabase, SettingsDatabase settingsDatabase, ConnectionInfoDatabase connectionInfoDatabase)
 {
     UpdateSettingsVisual(languageDatabase);
     FileNames = FileOperations.GetFileNames("lang", FileOperations.IsJsonChecker);
     if (FileNames.Count == 0)
     {
         FileOperations.AddUnsucessfullImportTask("Missing language files in \nlang folder");
         FileOperations.UnsuccessImportTaskStack.Pop().Start();
     }
     if (settingsDatabase.Database.ContainsKey("Language"))
     {
         if (fileNames.Contains(settingsDatabase.Database["Language"]))
         {
             selectedIndex = FileNames.IndexOf(settingsDatabase.Database["Language"]);
         }
     }
     else
     {
         selectedIndex = 0;
     }
     SaveSettingsCommand = ReactiveCommand.Create(() => {
         settingsDatabase.ChangeParameter("Language", FileNames[selectedIndex]);
         languageDatabase.ImportLanguage(FileNames[selectedIndex]);
         UpdateSettingsVisual(languageDatabase);
         connectionInfoDatabase.CreateConnectionText = languageDatabase.Database["CreateConnectionText"];
         languageDatabase.SetLanguageForConnDatabaseElements(connectionInfoDatabase.Database);
     });
 }
Ejemplo n.º 2
0
 public SettingsViewModel(LanguageDatabase languageDatabase, SettingsDatabase settingsDatabase, ConnectionInfoDatabase connectionInfoDatabase)
 {
     UpdateSettingsVisual(languageDatabase);
     FileNames = FileOperations.GetFileNames("lang");
     if (fileNames.Contains(settingsDatabase.Database["Language"]))
     {
         selectedIndex = FileNames.IndexOf(settingsDatabase.Database["Language"]);
     }
     SaveSettingsCommand = ReactiveCommand.Create(() => {
         settingsDatabase.ChangeParameter("Language", FileNames[selectedIndex]);
         languageDatabase.ImportLanguage(FileNames[selectedIndex]);
         UpdateSettingsVisual(languageDatabase);
         connectionInfoDatabase.CreateConnectionText = languageDatabase.Database["CreateConnectionText"];
         languageDatabase.SetLanguageForAllElementsInDatabase(connectionInfoDatabase.Database);
     });
 }
Ejemplo n.º 3
0
 public int IndexOf(string filePath)
 {
     return(FileNames.IndexOf(filePath));
 }
Ejemplo n.º 4
0
 public void BringLastTabToFront()
 {
     ActiveTabIndex = FileNames.IndexOf(FileNames.Last());
 }