public override void SetProject(Project project) { }
public override void SetProject(Project project) { Logger.Log("ctrlHelp > " + project.Name); }
public async System.Threading.Tasks.Task SetProject(Project project) { if (WPSuite.ConnectedUser == null) { Logger.Log("SetProject (ctrlDashBoardSprings) - User is null!!"); await UIHelper.PerformLogout(); return; } try { tvSprings.BeginUpdate(); tvSprings.AfterSelect -= tvSprings_AfterSelect; tvSprings.Nodes.Clear(); Logger.Log("Get springs for " + project.Name); var mres = await WebCallFactory.GetSprings(project.Id, WPSuite.ConnectedUser.Id); if (mres.Error) throw mres.Exception; foreach (Spring mspring in mres.Springs) { var mn = new TreeNode(mspring.Name) { Tag = mspring }; if(mspring.Categories != null) mn.Nodes.AddRange(mspring.Categories .Select(CreateTreeNodeItem) .ToArray()); tvSprings.Nodes.Add(mn); } var msn = tvSprings.Nodes .Cast<TreeNode>() .FirstOrDefault(tn => (tn.Tag as Spring)?.Id == Settings.Default.LastSelectedSpringId); var mcn = FlattenTree(tvSprings.Nodes .Cast<TreeNode>()) .FirstOrDefault(tn => (tn.Tag as Category)?.Id == Settings.Default.LastSelectedCategoryId); tvSprings.AfterSelect += tvSprings_AfterSelect; var mmn = mcn ?? msn ?? tvSprings.Nodes.Cast<TreeNode>().FirstOrDefault(); if (mmn != null) { mmn.EnsureVisible(); tvSprings.SelectedNode = mmn; } if (Settings.Default.LastSelectedCategoryId != 0) WPSuite.SelectedCategory = mres.Springs .SelectMany(s => s.Categories) .FirstOrDefault(c => c.Id == Settings.Default.LastSelectedCategoryId); UIHelper.HideLoader(); } catch (Exception mex) { UIHelper.HideLoader(); UIHelper.ShowError(mex); } finally { tvSprings.EndUpdate(); } }
private ListViewItem CreateProjectRow(Project project) { return new ListViewItem(project.Name) { Tag = project.Id }; }
private void ShowChatsForProject(Project project) { Logger.Log("ctrlChats > " + project.Name); }
public override void SetProject(Project project) { ShowChatsForProject(project); }
public abstract void SetProject(Project project);
public static void ShowProjectEdit(Project project, Func<Project, Task> afterSave = null) { var mc = new ctrlProjectEdit(project); mc.AfterSave = async p => { if (afterSave != null) await afterSave(p); mc.ParentForm?.Close(); }; ShowControlInForm(mc, ShowInFormControlSize.ControlSize); }
public ctrlProjectEdit(Project project) { _project = project; }