public void loadAll() { popup.displayBlock("Please wait ..."); files = new List <LoadFiles>(); cbeCategoryList = new List <string>(); foreach (DataSettings ds in settings.editSettings.setElementsListView.data) { cbeCategoryList.Add(ds.name); //категории для комбобокса //читаем все папки LoadFiles fl = new LoadFiles(); fl.load(ds.path); fl.updateNameFile(); fl.copy(); files.Add(fl); } //устанавливаем значения для комбобокса ComboBoxElements cbeCategory = new ComboBoxElements() { bindComboSearch = cbeCategoryList }; comboBox_name_category.DataContext = cbeCategory; comboBox_name_categoryExport.DataContext = cbeCategory; popup.displayNan(); }
private void btnLoadFiles_Click(object sender, RoutedEventArgs e) { LoadFiles loadFiles = new LoadFiles(); loadFiles.loadF820(txtF820.Text, out lstF820, out hF820); MessageBox.Show("Files Loaded"); }
public EnglishDraft(Database db, string selectReadings, string sourcePath) { _db = db; _selectTermReadings = selectReadings; SetIOPaths(sourcePath); _sourcetext = LoadFiles.TextFile(sourcePath); _draftTranslation = ProcessSourcetext(); }
public IDataLoadExecution Create(IDataLoadEventListener postLoadEventListener) { var loadArgsDictionary = new LoadArgsDictionary(LoadMetadata, _databaseConfiguration.DeployInfo); //warn user about disabled tasks var processTasks = LoadMetadata.ProcessTasks.ToList(); foreach (IProcessTask task in processTasks .Where(p => p.IsDisabled)) { postLoadEventListener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, "Found disabled ProcessTask" + task)); } //Get all the runtime tasks which are not disabled var factory = new RuntimeTaskPackager(processTasks.Where(p => !p.IsDisabled), loadArgsDictionary.LoadArgs, _cataloguesToLoad, _repository); var getFiles = new LoadFiles(factory.GetRuntimeTasksForStage(LoadStage.GetFiles)); var mounting = new PopulateRAW(factory.GetRuntimeTasksForStage(LoadStage.Mounting), _databaseConfiguration); var adjustRaw = factory.CreateCompositeDataLoadComponentFor(LoadStage.AdjustRaw, "Adjust RAW"); var migrateToStaging = new MigrateRAWToStaging(_databaseConfiguration, _loadConfigurationFlags); var adjustStaging = factory.CreateCompositeDataLoadComponentFor(LoadStage.AdjustStaging, "Adjust Staging"); var migrateStagingToLive = new MigrateStagingToLive(_databaseConfiguration, _loadConfigurationFlags); var postLoad = factory.CreateCompositeDataLoadComponentFor(LoadStage.PostLoad, "Post Load"); var archiveFiles = new ArchiveFiles(_loadConfigurationFlags); var loadStagingDatabase = new CompositeDataLoadComponent(new List <IDataLoadComponent> { mounting, adjustRaw, migrateToStaging }); var adjustStagingAndMigrateToLive = new CompositeDataLoadComponent(new List <IDataLoadComponent> { loadStagingDatabase, adjustStaging, migrateStagingToLive, postLoad }); var components = new List <IDataLoadComponent> { getFiles, adjustStagingAndMigrateToLive, archiveFiles }; return(new SingleJobExecution(components)); }
private void btnLoad_Click(object sender, RoutedEventArgs e) { LoadFiles loadFiles = new LoadFiles(); loadFiles.loadF741(txtOldF741.Text, out lstOldF741, out hOldF741); loadFiles.loadF820(txtF820.Text, out lstF820, out hF820); loadFiles.loadF741(txtNewF741.Text, out lstNewF741, out hNewF741); loadFiles.loadF741(txtTurnOnDate.Text, out lstTurnOnDate, out hTurnOnDate); MessageBox.Show("Files Loaded"); }
public string folderPath = null; //保存选择的路径 void Awake() { if (instance == null) { instance = this; } loadFiles = this.GetComponent <LoadFiles>(); loadImgModel = GetComponent <LoadImageModel>() ?? gameObject.AddComponent <LoadImageModel>(); folderPath = null; }
public void LoadFiles() //загружаем все файлы из директорий экспорта { files = new List <LoadFiles>(); ds = settings.editSettings.setElementsListView.data; //берем эти данные токо при копировании foreach (DataSettings path in ds) { LoadFiles lf = new LoadFiles(); lf.load(path.path); files.Add(lf); } }
public void button_openPath() { popup.displayBlock("Loading file ..."); OpenPath op = new OpenPath(); string path = op.open(); if (path != "") { label_pathOpen.Content = path; files = new LoadFiles(); files.load(label_pathOpen.Content.ToString()); editFiles = new EditFiles(); editFiles.main = files.main; editFiles.startEdit(); files.copy(); list_name_main.ItemsSource = files.mainCopy; list_name_main.Items.Refresh(); //подготовим комбобоксы взяв инфу из настроек List <string> cbeVersionList = new List <string>() { "01", "02", "03", "04", "05", "06", "07", "09", "10" }; ComboBoxElements cbeVersion = new ComboBoxElements() { bindComboSearch = cbeVersionList }; comboBox_name_version.DataContext = cbeVersion; List <string> cbeCategoryList = new List <string>(); cbeCategoryList.Add(""); foreach (DataSettings ds in settings.editSettings.setElementsListView.data) { cbeCategoryList.Add(ds.name); } ComboBoxElements cbeCategory = new ComboBoxElements() { bindComboSearch = cbeCategoryList }; comboBox_name_category.DataContext = cbeCategory; //комбо для поиска List <string> cbeSList = new List <string>() { "Artist", "Title", "Album", "Genre", "Album Artist", "Year" }; ComboBoxElements cbeS = new ComboBoxElements() { bindComboSearch = cbeSList }; comboBox_name_search.DataContext = cbeS; } popup.displayNan(); }
public void button_refresh() { popup.displayBlock("Refresh ..."); files = new LoadFiles(); files.load(label_pathOpen.Content.ToString()); editFiles = new EditFiles(); editFiles.main = files.main; editFiles.startEdit(); files.copy(); list_name_main.ItemsSource = files.mainCopy; list_name_main.Items.Refresh(); popup.displayNan(); }
//Узнаем несовпвдвет ли файл c уже имеющимися в базе public bool fileIsFile(LoadFiles lf, AudioFiles fx) { bool isFile = true; foreach (AudioFiles element in lf.main) { char[] characters = element.fileName.ToCharArray(); string versionBase = characters[6].ToString() + characters[7].ToString(); if (element.artist == fx.artist && element.title.Split('(')[0] == fx.title.Split('(')[0] && element.album == fx.album && element.genre == fx.genre && element.albumArtist == fx.albumArtist && element.year == fx.year && versionBase == fx.version) { isFile = false;//файл совпадает } } return(isFile); }
private IEnumerable <string> LoadSourceFiles(string dir) { List <string> files = Directory.EnumerateFiles(dir, "T????f???.txt").ToList(); List <string> otherFiles = Directory.EnumerateFiles(dir, "T???f???.txt").ToList(); files.AddRange(otherFiles); List <string> lines = new List <string>(); foreach (string file in files) { lines.AddRange(LoadFiles.TextFile(file)); } return(lines); }
public int Spirit; //精神-->Crit|Hit public BattleUnit GetBattleUnit(BattleUnitView view, Vector2Int pos) { BattleUnit unit = new BattleUnit(Name, UnitSide.Ally, view, pos); unit.HotKeys = HotKeys; unit.Skills = new List <Skill>(); for (int i = 0; i < HotKeys.Count; i++) { if (HotKeys[i].type == 0) { Skill skill = LoadFiles.GetSkill(Skills[HotKeys[i].param]); unit.Skills.Add(skill); } else { //Todo Item } } return(unit); }
public static void StartServer() { LoadFiles.LoadXML(); Process.Start(LoadFiles.globalPaths.executeServerFilePath); }
public static void LoadXMLFile() { LoadFiles.LoadXML(); }
public static void SaveXMLFile() { LoadFiles.SetPaths(); LoadFiles.SaveXML(); }
static void Main(string[] args) { CreateFiles.CreateAllFiles(); LoadFiles.LoadAllFiles(); }
/// <summary> /// Basic settings are configured on the view that is attached to this VM. /// </summary> /// <param name="screen"></param> public BasicSettingsViewModel(IScreen screen) { HostScreen = screen; // Look for a currently loaded cert and update the status... // We can't start this b.c. the ToProperty is lazy - and it won't // fire until Status is data-bound! LookupCertStatus = ReactiveCommand.CreateAsyncTask(a => SecurityUtils.FindCert(SecurityUtils.CERNCertName)); LookupCertStatus .Select(c => c == null ? "No Cert Loaded" : string.Format("Loaded (expires {0})", c.ValidTo.ToLocalTime().ToString("yyyy-MM-dd HH:mm"))) .ToProperty(this, x => x.Status, out _status, "", RxApp.MainThreadScheduler); LookupCertStatus .ExecuteAsync() .Subscribe(); // Error and status messages... var errors = new Subject <string>(); errors .ToProperty(this, x => x.Error, out _error, "", RxApp.MainThreadScheduler); // Given a file and a password, see if we can install it as a cert // in our internal repository. LoadFiles = ReactiveCommand.Create(); LoadFiles .Subscribe(x => errors.OnNext("")); var files = LoadFiles .Cast <Tuple <IReadOnlyList <StorageFile>, string> >(); files .Where(finfo => finfo.Item1 == null || finfo.Item1.Count != 1) .Select(f => "Invalid certificate file") .Subscribe(errors); files .Where(finfo => finfo.Item1 != null && finfo.Item1.Count == 1) .ObserveOn(RxApp.MainThreadScheduler) .Select(mf => { // We use this double subscribe because the readBufferAsync and ImportPfxDataAsync often return exceptions. // If we let the exception bubble all the way up, it terminates the sequence. Which means if the user entered // the wrong password they wouldn't get a chance to try again! return(Observable.Return(mf) .SelectMany(async f => { // Work around for the TplEventListener not working correctly. // https://social.msdn.microsoft.com/Forums/windowsapps/en-US/3e505e04-7f30-4313-aa47-275eaef333dd/systemargumentexception-use-of-undefined-keyword-value-1-for-event-taskscheduled-in-async?forum=wpdevelop await Task.Delay(1); var fs = f.Item1[0] as StorageFile; var buffer = await FileIO.ReadBufferAsync(fs); var cert = CryptographicBuffer.EncodeToBase64String(buffer); await CertificateEnrollmentManager.ImportPfxDataAsync(cert, f.Item2, ExportOption.NotExportable, KeyProtectionLevel.NoConsent, InstallOptions.DeleteExpired, SecurityUtils.CERNCertName); return Unit.Default; })); }) .Subscribe(c => c.Subscribe( g => LookupCertStatus.ExecuteAsync().Subscribe(), e => errors.OnNext(e.Message.TakeFirstLine()) )); // Set/Get the file expiration policy. CacheDecayOptions = ExpirationOptions.GetListExpirationOptions(); // Get the list of indico api keys we are watching // and hook up the MV for doing the api key manipulation ApiKeysForIndico = new ReactiveList <IndicoApiKey>(); ApiKeysForIndico.AddRange(IndicoApiKeyAccess.LoadAllKeys()); IndicoApiKeyAccess.IndicoApiKeysUpdated .Subscribe(_ => { using (ApiKeysForIndico.SuppressChangeNotifications()) { ApiKeysForIndico.Clear(); ApiKeysForIndico.AddRange(IndicoApiKeyAccess.LoadAllKeys()); } }); ShowIndicoApiKey = ReactiveCommand.Create(); ShowIndicoApiKey .Cast <IndicoApiKey>() .Select(x => new AddOrUpdateIndicoApiKeyViewModel(x)) .ToProperty(this, x => x.IndicoApiKey, out _indicoApiKeyVM, new AddOrUpdateIndicoApiKeyViewModel(null)); }
static void Main(string[] args) { //CreateFiles.CreateAllFiles(); LoadFiles.LoadAllFiles(); System.Console.Read(); }
private void OpenFolderButton_Click(object sender, RoutedEventArgs e) { LoadFiles?.Invoke(sender, e); this.AudioDataGrid.ItemsSource = _presenter.AudioData; }
public void exportOne(int idFileExport) { Console.WriteLine(idFileExport); ParserName parser = new ParserName(); AudioFiles fileExport = filesExport[idFileExport]; //Что экспортить DataSettings dataSet = ds.Find(x => x.name == fileExport.category); //куда экспортить int idCategory = ds.FindIndex(x => x.name == fileExport.category); //id для экспорта и проверок bool isFile = false; if (idCategory != -1) { LoadFiles testElements = files[idCategory]; //элементы для проверки //Узнаем несовпвдвет ли файл isFile = fileIsFile(testElements, fileExport); //получаем доступные значения для нумерации filesNumber(); //listNumberName[idCategory] лист с доступными намерами //listNumberMaxName[idCategory] масимальное значение int fileNameInt; if (isFile) { if (listNumberName[idCategory].Count > 0) { fileNameInt = listNumberName[idCategory][0]; } else { fileNameInt = listNumberMaxName[idCategory]; } if (fileExport.version != null) { bool isFileis = true; string name2 = ""; foreach (AudioFiles element in files[idCategory].main) { if (element.artist == fileExport.artist && element.title.Split('(')[0] == fileExport.title.Split('(')[0] && element.album == fileExport.album && element.genre == fileExport.genre && element.albumArtist == fileExport.albumArtist && element.year == fileExport.year) { isFileis = false;//файл совпадает name2 = element.fileName; } } if (isFileis) { if (listNumberName[idCategory].Count > 0) { listNumberName[idCategory].Remove(fileNameInt); } else { listNumberMaxName[idCategory]++; } string nameFile = dataSet.prefix + parser.IntToName(fileNameInt) + "-" + fileExport.version + fileExport.ext; File.Copy(fileExport.path, dataSet.path + "\\" + nameFile); } else { char[] cF = name2.ToString().ToCharArray(); name2 = cF[0].ToString() + cF[1].ToString() + cF[2].ToString() + cF[3].ToString() + cF[4].ToString(); string nameFile = name2 + "-" + fileExport.version + fileExport.ext; File.Copy(fileExport.path, dataSet.path + "\\" + nameFile); } } else { WindowWarning windowWarning = new WindowWarning(); windowWarning.warning_text.Content = "No version selected"; windowWarning.ShowDialog(); } } else { WindowWarning windowWarning = new WindowWarning(); windowWarning.warning_text.Content = "This file already exists"; windowWarning.ShowDialog(); } } else { WindowWarning windowWarning = new WindowWarning(); windowWarning.warning_text.Content = "Category not selected"; windowWarning.ShowDialog(); } }
private void Awake() { LoadFiles.LoadXML(); }
public void GetLoadForm(LoadFiles form) { this.form = form; }
// Use this for initialization void Start() { currentWeek = 0; totalMoney = 100; secretness = 50; //New database manager, holds all the databases dbManager = new DBManager (); screenManager = GameObject.FindGameObjectWithTag(Utility.ManagerMasterTag).GetComponent<ScreenManager>(); notificationManager = new NotificationManager(); LoadFiles files = new LoadFiles(dbManager); files.loadJSONFiles(); //add some test events dbManager.EventDB.addEvent(new RandomEvent("TestEvent", "This is a test event")); dbManager.EventDB.addEvent(new RandomEvent("TestEvent2", "Another test event")); InitializeGameScreenVariables(); }