public JProperty BuildData() { GroupsLoader groupsLoader = new GroupsLoader(); List <GroupsDTO> groupsData = groupsLoader.LoadData(this.configuration.GroupsInputFile); var groups = GetGroups(groupsData); return(groups); }
void Start() { foreach (ConfigNode GroupsLoader in GameDatabase.Instance.GetConfigNodes("PQSCity_Groups")) { AddGroups(GroupsLoader.GetNodes("GROUP")); if (GroupsLoader.HasValue("debug") && !debugAllGroups.Value) { debugAllGroups.SetFromString(GroupsLoader.GetValue("debug")); } } SaveGroups(); }
public void CallSLXLoader() { switch (Value) { case 1: { var tasks = new Task[2]; tasks[0] = Task.Factory.StartNew(() => { progBarVisibility = true; XlDataLoaderCreator xdlc = new KpfDataLoaderCreator(); XlDataLoader xdl = xdlc.CreateXlDataLoader(filePath, isTestMode, "РВПС"); xdl.UploadToDb(); }); tasks[1] = Task.Factory.StartNew(() => { XlDataLoaderCreator xdlc = new KpfDataLoaderCreator(); XlDataLoader xdl = xdlc.CreateXlDataLoader(filePath, isTestMode, "РВП"); xdl.UploadToDb(); }); Task.Factory.ContinueWhenAll(tasks, (Task) => { if (tasks.All(t => t.Status == TaskStatus.RanToCompletion)) { progBarVisibility = false; MessageBox.Show("Task ended."); } else { MessageBox.Show("Что-то не так!!! \n РВПС " + tasks[0].ToString() + ", РВП " + tasks[0].ToString()); } }); break; } case 2: { Task t = Task.Factory.StartNew(() => { progBarVisibility = true; XlDataLoaderCreator xdlc = new SzrcDataLoaderCreator(); XlDataLoader xdl = xdlc.CreateXlDataLoader(filePath, isTestMode, "Отчет"); xdl.UploadToDb(); }) .ContinueWith(Task => { progBarVisibility = false; MessageBox.Show("Task ended."); }); break; } case 3: { Task t = Task.Factory.StartNew(() => { progBarVisibility = true; XlDataLoaderCreator xdlc = new MBankDataLoaderCreator(); XlDataLoader xdl = xdlc.CreateXlDataLoader(filePath, isTestMode, "По_счетам"); xdl.UploadToDb(); }) .ContinueWith(Task => { progBarVisibility = false; MessageBox.Show("Task ended."); }); break; } case 4: { Task t = Task.Factory.StartNew(() => { progBarVisibility = true; CrmDataLoader crmdl = new CrmDataLoader(filePath, isTestMode, "Все клиенты Банка"); crmdl.UploadToDb(); }) .ContinueWith(Task => { progBarVisibility = false; MessageBox.Show("Task ended."); }); break; } case 5: { Task t = Task.Factory.StartNew(() => { progBarVisibility = true; OfsDataLoader ofsdl = new OfsDataLoader(filePath, isTestMode, "Лист1"); ofsdl.UploadToDb(); }) .ContinueWith(Task => { progBarVisibility = false; MessageBox.Show("Task ended."); }); break; } case 6: { Task t = Task.Factory.StartNew(() => { progBarVisibility = true; PsDataLoader psdl = new PsDataLoader(filePath, isTestMode); psdl.UploadToDb(); }) .ContinueWith(Task => { progBarVisibility = false; MessageBox.Show("Task ended!"); }); break; } case 7: { Task t = Task.Factory.StartNew(() => { progBarVisibility = true; GroupsLoader gl = new GroupsLoader(filePath, isTestMode); gl.UploadToDb(); }) .ContinueWith(Task => { progBarVisibility = false; MessageBox.Show("Task ended."); }); break; } default: { MessageBox.Show("Это невозможно!"); break; } } }