public void Move(IToolWindowGroup group, AppToolWindowLocation location) { if (group == null) { return; } var t = GetToolWindowGroup(group); location = Convert(location); if (t == null || t.Item1.Location == location || !t.Item2.TabContents.Any()) { return; } var activeContent = t.Item2.ActiveTabContent; Debug.Assert(activeContent != null); foreach (var c in t.Item2.TabContents.ToArray()) { Move(c, location); } if (activeContent != null) { var t2 = GetToolWindowGroup(activeContent); Debug.Assert(t2 != null); if (t2 != null) { t2.Item2.ActiveTabContent = activeContent; } } }
public void MoveTo(IToolWindowGroup destGroup, IToolWindowContent content) { if (destGroup == null) { throw new ArgumentNullException(nameof(destGroup)); } if (content == null) { throw new ArgumentNullException(nameof(content)); } var impl = GetTabContentImpl(content); Debug.Assert(impl != null); if (impl == null) { throw new InvalidOperationException(); } if (destGroup == this) { return; } var destGroupImpl = destGroup as ToolWindowGroup; if (destGroupImpl == null) { throw new InvalidOperationException(); } impl.PrepareMove(); Close(impl); impl = new TabContentImpl(destGroupImpl, content); impl.PrepareMove(); destGroupImpl.TabGroup.Add(impl); }
public ToolWindowGroupState Save(IToolWindowGroup g) { var contents = g.TabContents.ToList(); this.Index = contents.IndexOf(g.ActiveTabContent); foreach (var c in contents) { Contents.Add(new ToolWindowContentState().Save(c)); } return(this); }
Tuple <ToolWindowUI, IToolWindowGroup> GetToolWindowGroup(IToolWindowGroup group) { foreach (var ui in this.toolWindowUIs.Values) { if (ui.ToolWindowGroupManager.TabGroups.Contains(group)) { return(Tuple.Create(ui, group)); } } return(null); }
void SaveLocationAndActivate(IToolWindowGroup g, IToolWindowContent content, AppToolWindowLocation location, bool active, bool focus) { if (active) { g.ActiveTabContent = content; } if (focus) { g.SetFocus(content); } savedLocations[content.Guid] = location; }
public void Close(IToolWindowGroup group) { if (group == null) { throw new ArgumentNullException(nameof(group)); } var impl = group as ToolWindowGroup; if (impl == null) { throw new InvalidOperationException(); } tabGroupService.Close(impl.TabGroup); }
public bool Owns(IToolWindowGroup toolWindowGroup) { if (toolWindowGroup == null) { return(false); } foreach (var ui in toolWindowUIs.Values) { if (ui.ToolWindowGroupManager.TabGroups.Contains(toolWindowGroup)) { return(true); } } return(false); }
public bool CanMove(IToolWindowGroup group, AppToolWindowLocation location) { if (group == null) { return(false); } var t = GetToolWindowGroup(group); location = Convert(location); if (t == null || t.Item1.Location == location || !t.Item2.TabContents.Any()) { return(false); } return(true); }
internal bool TryAdd(ToolWindowUI ui, IToolWindowGroup g, Guid guid) { var content = Create(guid); if (content == null) { return(false); } if (GetToolWindowGroup(content) != null) { return(false); } g.Add(content); return(true); }
public void MoveTo(IToolWindowGroup destGroup, ToolWindowContent content) { if (destGroup == null) throw new ArgumentNullException(nameof(destGroup)); if (content == null) throw new ArgumentNullException(nameof(content)); var impl = GetTabContentImpl(content); Debug.Assert(impl != null); if (impl == null) throw new InvalidOperationException(); if (destGroup == this) return; var destGroupImpl = destGroup as ToolWindowGroup; if (destGroupImpl == null) throw new InvalidOperationException(); impl.PrepareMove(); Close(impl); impl = new TabContentImpl(destGroupImpl, content); impl.PrepareMove(); destGroupImpl.TabGroup.Add(impl); }
/// <summary> /// Constructor /// </summary> /// <param name="selected">Selected tab group or null</param> /// <param name="unselected">Unselected tab group or null</param> public ToolWindowGroupSelectedEventArgs(IToolWindowGroup selected, IToolWindowGroup unselected) { Selected = selected; Unselected = unselected; }
/// <summary> /// Constructor /// </summary> /// <param name="tabGroup">Tab group</param> /// <param name="selected">Selected content or null</param> /// <param name="unselected">Unselected content or null</param> public ToolWindowSelectedEventArgs(IToolWindowGroup tabGroup, IToolWindowContent selected, IToolWindowContent unselected) { this.TabGroup = tabGroup; this.Selected = selected; this.Unselected = unselected; }
public ToolWindowGroupContext(IMainToolWindowManager mainToolWindowManager, IToolWindowGroup toolWindowGroup) { this.MainToolWindowManager = mainToolWindowManager; this.ToolWindowGroupManager = toolWindowGroup.ToolWindowGroupManager; this.ToolWindowGroup = toolWindowGroup; }
ITabGroup GetTabGroup(IToolWindowGroup g) => tabGroupService.TabGroups.FirstOrDefault(a => a.Tag == g);
/// <summary> /// Constructor /// </summary> /// <param name="added">true if it was added</param> /// <param name="tabGroup">Tab group</param> public ToolWindowGroupCollectionChangedEventArgs(bool added, IToolWindowGroup tabGroup) { Added = added; TabGroup = tabGroup; }
Tuple<ToolWindowUI, IToolWindowGroup> GetToolWindowGroup(IToolWindowGroup group) { foreach (var ui in this.toolWindowUIs.Values) { if (ui.ToolWindowGroupManager.TabGroups.Contains(group)) return Tuple.Create(ui, group); } return null; }
/// <summary> /// Constructor /// </summary> /// <param name="tabGroup">Tab group</param> /// <param name="selected">Selected content or null</param> /// <param name="unselected">Unselected content or null</param> public ToolWindowSelectedEventArgs(IToolWindowGroup tabGroup, ToolWindowContent selected, ToolWindowContent unselected) { TabGroup = tabGroup; Selected = selected; Unselected = unselected; }
internal bool TryAdd(ToolWindowUI ui, IToolWindowGroup g, Guid guid) { var content = Create(guid); if (content == null) return false; if (GetToolWindowGroup(content) != null) return false; g.Add(content); return true; }
public bool Owns(IToolWindowGroup toolWindowGroup) { if (toolWindowGroup == null) return false; foreach (var ui in toolWindowUIs.Values) { if (ui.ToolWindowGroupManager.TabGroups.Contains(toolWindowGroup)) return true; } return false; }
public void Move(IToolWindowGroup group, AppToolWindowLocation location) { if (group == null) return; var t = GetToolWindowGroup(group); location = Convert(location); if (t == null || t.Item1.Location == location || !t.Item2.TabContents.Any()) return; var activeContent = t.Item2.ActiveTabContent; Debug.Assert(activeContent != null); foreach (var c in t.Item2.TabContents.ToArray()) Move(c, location); if (activeContent != null) { var t2 = GetToolWindowGroup(activeContent); Debug.Assert(t2 != null); if (t2 != null) { t2.Item2.ActiveTabContent = activeContent; } } }
public void Close(IToolWindowGroup group) { if (group == null) throw new ArgumentNullException(nameof(group)); var impl = group as ToolWindowGroup; if (impl == null) throw new InvalidOperationException(); tabGroupService.Close(impl.TabGroup); }
void SaveLocationAndActivate(IToolWindowGroup g, IToolWindowContent content, AppToolWindowLocation location, bool active, bool focus) { if (active) g.ActiveTabContent = content; if (focus) g.SetFocus(content); savedLocations[content.Guid] = location; }
ITabGroup GetTabGroup(IToolWindowGroup g) { return(this.tabGroupManager.TabGroups.FirstOrDefault(a => a.Tag == g)); }
public ToolWindowGroupState Save(IToolWindowGroup g) { var contents = g.TabContents.ToList(); this.Index = contents.IndexOf(g.ActiveTabContent); foreach (var c in contents) Contents.Add(new ToolWindowContentState().Save(c)); return this; }
public bool CanMove(IToolWindowGroup group, AppToolWindowLocation location) { if (group == null) return false; var t = GetToolWindowGroup(group); location = Convert(location); if (t == null || t.Item1.Location == location || !t.Item2.TabContents.Any()) return false; return true; }
public ToolWindowGroupContext(IDsToolWindowService toolWindowService, IToolWindowGroup toolWindowGroup) { DsToolWindowService = toolWindowService; ToolWindowGroupService = toolWindowGroup.ToolWindowGroupService; ToolWindowGroup = toolWindowGroup; }
ITabGroup GetTabGroup(IToolWindowGroup g) { return this.tabGroupManager.TabGroups.FirstOrDefault(a => a.Tag == g); }