Пример #1
0
		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;
		}
Пример #2
0
		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;
		}
Пример #3
0
        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;
        }
Пример #4
0
		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;
			}
		}
Пример #5
0
        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;
                }
            }
        }
Пример #6
0
 public MenuTabGroupContext(ITabGroupService tabGroupService)
 {
     TabGroup        = tabGroupService.ActiveTabGroup;
     TabGroupService = tabGroupService;
 }
Пример #7
0
 public TabGroupContext(ITabGroup tabGroup)
 {
     TabGroup        = tabGroup;
     TabGroupService = tabGroup.TabGroupService;
 }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
 public TabGroupContext(ITabGroup tabGroup)
 {
     this.TabGroup        = tabGroup;
     this.TabGroupService = tabGroup.TabGroupService;
 }
Пример #11
0
		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;
		}