public ToolWindowGroupService(ITabGroupService tabGroupService) { this.tabGroupService = tabGroupService; tabSelectionChanged = new WeakEventList<ToolWindowSelectedEventArgs>(); tabGroupSelectionChanged = new WeakEventList<ToolWindowGroupSelectedEventArgs>(); toolWindowGroupCollectionChanged = new WeakEventList<ToolWindowGroupCollectionChangedEventArgs>(); this.tabGroupService.TabSelectionChanged += TabGroupService_TabSelectionChanged; this.tabGroupService.TabGroupSelectionChanged += TabGroupService_TabGroupSelectionChanged; this.tabGroupService.TabGroupCollectionChanged += TabGroupService_TabGroupCollectionChanged; }
public static SerializedTabGroupWindow Create(IDocumentTabContentFactoryService factory, ITabGroupService tabGroupService, string name) { int index = tabGroupService.TabGroups.ToList().IndexOf(tabGroupService.ActiveTabGroup); var stackedContentState = ((TabGroupService)tabGroupService).StackedContentState; var tgw = new SerializedTabGroupWindow(name, index, tabGroupService.IsHorizontal, stackedContentState); foreach (var g in tabGroupService.TabGroups) tgw.TabGroups.Add(SerializedTabGroup.Create(factory, g)); return tgw; }
public ToolWindowGroupService(ITabGroupService tabGroupService) { this.tabGroupService = tabGroupService; tabSelectionChanged = new WeakEventList <ToolWindowSelectedEventArgs>(); tabGroupSelectionChanged = new WeakEventList <ToolWindowGroupSelectedEventArgs>(); toolWindowGroupCollectionChanged = new WeakEventList <ToolWindowGroupCollectionChangedEventArgs>(); this.tabGroupService.TabSelectionChanged += TabGroupService_TabSelectionChanged; this.tabGroupService.TabGroupSelectionChanged += TabGroupService_TabGroupSelectionChanged; this.tabGroupService.TabGroupCollectionChanged += TabGroupService_TabGroupCollectionChanged; }
public void Remove(ITabGroupService mgr) { if (mgr == null) throw new ArgumentNullException(nameof(mgr)); int index = tabGroupServices.IndexOf((TabGroupService)mgr); Debug.Assert(index >= 0); if (index >= 0) { tabGroupServices.RemoveAt(index); if (selectedIndex >= tabGroupServices.Count) selectedIndex = tabGroupServices.Count - 1; } }
public void Remove(ITabGroupService mgr) { if (mgr == null) { throw new ArgumentNullException(nameof(mgr)); } int index = tabGroupServices.IndexOf((TabGroupService)mgr); Debug.Assert(index >= 0); if (index >= 0) { tabGroupServices.RemoveAt(index); if (selectedIndex >= tabGroupServices.Count) { selectedIndex = tabGroupServices.Count - 1; } } }
public MenuTabGroupContext(ITabGroupService tabGroupService) { TabGroup = tabGroupService.ActiveTabGroup; TabGroupService = tabGroupService; }
public TabGroupContext(ITabGroup tabGroup) { TabGroup = tabGroup; TabGroupService = tabGroup.TabGroupService; }
public IEnumerable <object> Restore(DocumentTabService documentTabService, IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroupService mgr) { mgr.IsHorizontal = IsHorizontal; for (int i = 0; i < TabGroups.Count; i++) { var stg = TabGroups[i]; var g = i == 0 ? mgr.ActiveTabGroup ?? mgr.Create() : mgr.Create(); yield return(null); foreach (var o in stg.Restore(documentTabService, documentTabContentFactoryService, g)) { yield return(o); } } if (StackedContentState != null) { ((TabGroupService)mgr).StackedContentState = StackedContentState; } var ary = mgr.TabGroups.ToArray(); if ((uint)Index < (uint)ary.Length) { mgr.ActiveTabGroup = ary[Index]; } yield return(null); }
public static SerializedTabGroupWindow Create(IDocumentTabContentFactoryService factory, ITabGroupService tabGroupService, string name) { int index = tabGroupService.TabGroups.ToList().IndexOf(tabGroupService.ActiveTabGroup); var stackedContentState = ((TabGroupService)tabGroupService).StackedContentState; var tgw = new SerializedTabGroupWindow(name, index, tabGroupService.IsHorizontal, stackedContentState); foreach (var g in tabGroupService.TabGroups) { tgw.TabGroups.Add(SerializedTabGroup.Create(factory, g)); } return(tgw); }
public TabGroupContext(ITabGroup tabGroup) { this.TabGroup = tabGroup; this.TabGroupService = tabGroup.TabGroupService; }
public IEnumerable<object> Restore(DocumentTabService documentTabService, IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroupService mgr) { mgr.IsHorizontal = IsHorizontal; for (int i = 0; i < TabGroups.Count; i++) { var stg = TabGroups[i]; var g = i == 0 ? mgr.ActiveTabGroup ?? mgr.Create() : mgr.Create(); yield return null; foreach (var o in stg.Restore(documentTabService, documentTabContentFactoryService, g)) yield return o; } if (StackedContentState != null) ((TabGroupService)mgr).StackedContentState = StackedContentState; var ary = mgr.TabGroups.ToArray(); if ((uint)Index < (uint)ary.Length) mgr.ActiveTabGroup = ary[Index]; yield return null; }