///<summary>Загрука настроек из файла</summary> private void Settings_Loaded(object sender, RoutedEventArgs e) { IDiscriptionApp discription = new DiscriptionAppInServer("127.0.0.1", 8005); AppVersionSetting appSetting = discription.GetSetting(AppName, AppVers); Discription.Text = appSetting.AppDiscription; switch (appSetting.ActialFlag) { case "True": Check.IsChecked = true; break; case "False": Check.IsChecked = false; break; } FileInDBServerRepo repo = new FileInDBServerRepo("127.0.0.1", 8005); VersionNumber.TryParse(AppVers, out VersionNumber number); IList <FileOfVersion> testfile = repo.FindFileOfVersions(new AppVersion(AppName, number)); List <string> fileName = new List <string>(); for (int i = 0; i < testfile.Count; i++) { fileName.Add(testfile[i].FilePath); } exeFile.ItemsSource = (fileName); exeFile.Text = appSetting.NameExe; AppText.Text = "Настройки приложения: " + AppName + " " + number.ToString(); }
///<summary>Список приложений подверженных версионному контролю</summary> private List <AppVersion> listApp() { VersionInDBServerRepo repo_fileDB = new VersionInDBServerRepo("127.0.0.1", 8005); IDiscriptionApp discription = new DiscriptionAppInServer("127.0.0.1", 8005); IList <AppVersion> versionsDB = repo_fileDB.FindAll(); List <AppVersion> versionsSort = new List <AppVersion>(); string[] VersionsApps = (from vers in versionsDB select vers.VersionName.ToString()).Distinct().ToArray(); versionsSort.AddRange(from string vSort in VersionsApps where discription.GetAppVersion(vSort) != null select discription.GetAppVersion(vSort)); return(versionsSort); }
///<summary>Сохранение настроек в файл</summary> private void SaveSetting_Click(object sender, RoutedEventArgs e) { IDiscriptionApp discription = new DiscriptionAppInServer("127.0.0.1", 8005); AppVersionSetting appSetting = discription.GetSetting(AppName, AppVers); appSetting.ActialAppName = AppName; appSetting.ActialAppVersion = AppVers; appSetting.AppDiscription = Discription.Text; appSetting.ActialFlag = Check.IsChecked.Value.ToString(); appSetting.NameExe = exeFile.Text; discription.SaveSetting(appSetting); Close(); }