private async void GetProjectsCommand() { ProjectList.Clear(); List <Project> tmp = new List <Project>(); if (Mode == "my") { OutputMessages.Add(new OutputMessage { Message = "Loading " + CurrentUser + "'s project(s)...", Level = "debug" }); _logService.Write(this, "Loading " + CurrentUser + "'s project(s)...", "debug"); tmp = await _dbService.GetProjects(Person); } else { OutputMessages.Add(new OutputMessage { Message = "Loading all project(s)...", Level = "debug" }); _logService.Write(this, "Loading all project(s)...", "debug"); tmp = await _dbService.GetProjects(); } OutputMessages.Add(new OutputMessage { Message = tmp.Count + " project(s) loaded!", Level = "debug" }); _logService.Write(this, tmp.Count + " project(s) loaded", "debug"); foreach (var item in tmp) { ProjectList.Add(item); } }
void loadOperationProject_Completed(object sender, EventArgs e) { ProjectList.Clear(); LoadOperation loadOperation = sender as LoadOperation; foreach (ProductManager.Web.Model.project project in loadOperation.Entities) { ProjectEntity projectEntity = new ProjectEntity(); projectEntity.Project = project; projectEntity.Update(); ProjectList.Add(projectEntity); } UpdateChanged("ProjectList"); IsBusy = false; }
private void LoadOperationProjectCompleted(LoadOperation <ProductManager.Web.Model.project> aLoadOperation) { ProjectList.Clear(); foreach (ProductManager.Web.Model.project project in aLoadOperation.Entities) { ProjectEntity projectEntity = new ProjectEntity(); projectEntity.Project = project; projectEntity.Update(); ProjectList.Add(projectEntity); } if (aLoadOperation.TotalEntityCount != -1) { this.projectView.SetTotalItemCount(aLoadOperation.TotalEntityCount); } UpdateChanged("ProjectList"); this.IsBusy = false; }
void LoadWorkspace() { var dlg = new OpenFileDialog() { Filter = "work space|*.workspace|(*.*)|*.*" }; if (dlg.ShowDialog() == true) { var sp = CommonLib.CommonProc.LoadObjFromFile <Workspace>(dlg.FileName); if (sp != null) { var count = sp.AnalyseList.Count + sp.BacktestingList.Count; var array = new ProjectSummaryViewModelBase[count]; foreach (var kv in sp.AnalyseList) { kv.Value.RecoverySerialObject(); var svm = new AnalyseProjectSummaryViewModel() { TargetProject = kv.Value, Open = Open, Delete = Delete, Start = Start, Pause = Pause, Stop = Stop }; array[kv.Key] = svm; } foreach (var kv in sp.BacktestingList) { kv.Value.RecoverySerialObject(); var svm = new BacktestingProjectSummaryViewModel() { TargetProject = kv.Value, Open = Open, Delete = Delete, Start = Start, Pause = Pause, Stop = Stop }; array[kv.Key] = svm; } ProjectList.Clear(); foreach (var p in array) { ProjectList.Add(p); } } else { MessageBox.Show("Load workspace faild from " + dlg.FileName); } } }
private void LoadProjects() { try { ProjectList.Clear(); string task = "loadProjects"; client = new TcpClient(); client.Connect(ep); NetworkStream ns = client.GetStream(); StreamWriter sw = new StreamWriter(ns); sw.WriteLine(task); sw.Flush(); byte[] data = new byte[50000]; int bytes = ns.Read(data, 0, data.Length); ObservableCollection <ClassesLibaryBilling.Project> pl = new ObservableCollection <ClassesLibaryBilling.Project>(); pl = FromByteArray <ObservableCollection <ClassesLibaryBilling.Project> >(data); foreach (var item in pl) { ProjectList.Add(item); } sw.Close(); ns.Close(); client.Close(); } catch (Exception) { MessageBox.Show("Сервер выключен либо отсутствует соидинение с интеренетом"); } }
public void Stop() { RepositoryList.Clear(); SolutionList.Clear(); ProjectList.Clear(); }