Exemple #1
0
 public ToolWindowGroup(IToolWindowGroupManager toolWindowGroupManager, ITabGroup tabGroup)
 {
     this.toolWindowGroupManager = toolWindowGroupManager;
     this.tabGroup = tabGroup;
     this.tabGroup.Tag = this;
     this.tabGroup.TabContentAttached += TabGroup_TabContentAttached;
 }
Exemple #2
0
 public ToolWindowGroup(IToolWindowGroupService toolWindowGroupService, ITabGroup tabGroup)
 {
     this.ToolWindowGroupService = toolWindowGroupService;
     this.TabGroup     = tabGroup;
     this.TabGroup.Tag = this;
     this.TabGroup.TabContentAttached += TabGroup_TabContentAttached;
 }
 public ToolWindowGroup(IToolWindowGroupManager toolWindowGroupManager, ITabGroup tabGroup)
 {
     this.ToolWindowGroupManager = toolWindowGroupManager;
     this.TabGroup     = tabGroup;
     this.TabGroup.Tag = this;
     this.TabGroup.TabContentAttached += TabGroup_TabContentAttached;
 }
Exemple #4
0
        TabContentImpl CreateNewTab(ITabGroup tabGroup)
        {
            var impl = new TabContentImpl(this, fileTabUIContextLocatorCreator.Create(), refFactories);

            tabGroup.Add(impl);
            return(impl);
        }
Exemple #5
0
        internal void Add(ITabGroup group, IFileTabContent tabContent, object serializedUI, Action <ShowTabContentEventArgs> onShown)
        {
            Debug.Assert(TabGroupManager.TabGroups.Contains(group));
            var tab = OpenEmptyTab(group);

            tab.Show(tabContent, serializedUI, onShown);
        }
Exemple #6
0
        TabContentImpl CreateNewTab(ITabGroup tabGroup)
        {
            var impl = new TabContentImpl(this, documentTabUIContextLocatorProvider.Create(), referenceDocumentTabContentProviders, defaultDocumentTabContentProviders, referenceHandlers);

            tabGroup.Add(impl);
            return(impl);
        }
        internal void Add(ITabGroup group, DocumentTabContent tabContent, object uiState, Action <ShowTabContentEventArgs> onShown)
        {
            Debug.Assert(TabGroupService.TabGroups.Contains(group));
            var tab = OpenEmptyTab(group);

            tab.Show(tabContent, uiState, onShown);
        }
Exemple #8
0
        TabContentImpl CreateNewTab(ITabGroup tabGroup)
        {
            var impl = new TabContentImpl(this, fileTabUIContextLocatorProvider.Create(), referenceFileTabContentProviders, defaultFileTabContentProviders);

            tabGroup.Add(impl);
            return(impl);
        }
        IDocumentTab OpenEmptyTab(ITabGroup g)
        {
            var impl = CreateNewTab(g);

            g.ActiveTabContent = impl;
            return(impl);
        }
Exemple #10
0
		public static SerializedTabGroup Create(IFileTabContentFactoryManager creator, ITabGroup g) {
			int index = g.TabContents.ToList().IndexOf(g.ActiveTabContent);
			var tg = new SerializedTabGroup(index);

			foreach (IFileTab tab in g.TabContents) {
				var t = SerializedTab.TryCreate(creator, tab);
				if (t != null)
					tg.Tabs.Add(t);
			}

			return tg;
		}
Exemple #11
0
        public void Close(ITabGroup tabGroup)
        {
            if (tabGroup == null)
            {
                throw new ArgumentNullException();
            }
            var impl = tabGroup as TabGroup;

            if (impl == null)
            {
                throw new InvalidOperationException();
            }
            impl.CloseAllTabs();
        }
Exemple #12
0
		public static SerializedTabGroup Create(IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g) {
			int index = g.TabContents.ToList().IndexOf(g.ActiveTabContent);
			var tg = new SerializedTabGroup(index);

			foreach (IDocumentTab tab in g.TabContents) {
				var t = SerializedTab.TryCreate(documentTabContentFactoryService, tab);
				if (t != null)
					tg.Tabs.Add(t);
			}

			return tg;
		}
Exemple #13
0
 public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return tabGroup == null ? null : (ToolWindowGroup)tabGroup.Tag;
 }
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="selected">Selected tab group or null</param>
		/// <param name="unselected">Unselected tab group or null</param>
		public TabGroupSelectedEventArgs(ITabGroup selected, ITabGroup unselected) {
			this.Selected = selected;
			this.Unselected = unselected;
		}
Exemple #15
0
        public IEnumerable <object> Restore(FileTabManager fileTabManager, IFileTabContentFactoryManager fileTabContentFactoryManager, ITabGroup g)
        {
            foreach (var st in Tabs)
            {
                foreach (var o in st.TryRestore(fileTabManager, fileTabContentFactoryManager, g))
                {
                    yield return(o);
                }
            }
            var ary = g.TabContents.ToArray();

            if ((uint)Index < (uint)ary.Length)
            {
                g.ActiveTabContent = ary[Index];
            }
            yield return(null);
        }
 public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => (ToolWindowGroup)tabGroup?.Tag;
Exemple #17
0
		public ToolWindowGroup(IToolWindowGroupService toolWindowGroupService, ITabGroup tabGroup) {
			ToolWindowGroupService = toolWindowGroupService;
			TabGroup = tabGroup;
			TabGroup.Tag = this;
			TabGroup.TabContentAttached += TabGroup_TabContentAttached;
		}
Exemple #18
0
 internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => ToolWindowGroup.GetToolWindowGroup(tabGroup);
		internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => ToolWindowGroup.GetToolWindowGroup(tabGroup);
Exemple #20
0
 public GuidObjectsProvider(InitializeContextMenuHelper owner, ITabGroup tabGroup)
 {
     this.owner    = owner;
     this.tabGroup = tabGroup;
 }
Exemple #21
0
 public void Close(ITabGroup tabGroup)
 {
     if (tabGroup == null)
         throw new ArgumentNullException();
     var impl = tabGroup as TabGroup;
     if (impl == null)
         throw new InvalidOperationException();
     impl.CloseAllTabs();
 }
 public bool Owns(ITabGroup tabGroup) => TabGroupService.TabGroups.Contains(tabGroup);
Exemple #23
0
		public IEnumerable<object> Restore(DocumentTabService documentTabService, IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g) {
			foreach (var st in Tabs) {
				foreach (var o in st.TryRestore(documentTabService, documentTabContentFactoryService, g))
					yield return o;
			}
			var ary = g.TabContents.ToArray();
			if ((uint)Index < (uint)ary.Length)
				g.ActiveTabContent = ary[Index];
			yield return null;
		}
Exemple #24
0
		public IEnumerable<object> TryRestore(DocumentTabService documentTabService, IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g) {
			var guid = Content.Attribute<Guid?>(CONTENT_GUID_ATTR);
			if (guid == null)
				yield break;
			var ctx = new GetNodesContext();
			foreach (var o in GetNodes(ctx, documentTabService.DocumentTreeView))
				yield return o;
			if (ctx.Nodes == null)
				yield break;
			var tabContent = documentTabContentFactoryService.Deserialize(guid.Value, Content, ctx.Nodes);
			yield return null;
			if (tabContent == null)
				yield break;
			documentTabService.Add(g, tabContent, null, (Action<ShowTabContentEventArgs>)(a => {
				if (a.Success) {
					var uiContext = tabContent.DocumentTab.UIContext;
					tabContent.DocumentTab.DeserializeUI((ISettingsSection)TabUI);
					var obj = uiContext.DeserializeUIState(UI);
					uiContext.RestoreUIState(obj);
				}
			}));
			yield return null;
		}
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="selected">Selected tab group or null</param>
		/// <param name="unselected">Unselected tab group or null</param>
		public TabGroupSelectedEventArgs(ITabGroup selected, ITabGroup unselected) {
			Selected = selected;
			Unselected = unselected;
		}
Exemple #26
0
 public IEnumerable<object> Restore(FileTabManager fileTabManager, IFileTabContentFactoryManager creator, ITabGroup g)
 {
     foreach (var st in Tabs) {
         foreach (var o in st.TryRestore(fileTabManager, creator, g))
             yield return o;
     }
     var ary = g.TabContents.ToArray();
     if ((uint)Index < (uint)ary.Length)
         g.ActiveTabContent = ary[Index];
     yield return null;
 }
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="added">true if it was added</param>
		/// <param name="tabGroup">Tab group</param>
		public TabGroupCollectionChangedEventArgs(bool added, ITabGroup tabGroup) {
			this.Added = added;
			this.TabGroup = tabGroup;
		}
 public IContextMenuCreator InitializeContextMenu(IMenuManager menuManager, ITabGroup tabGroup, FrameworkElement elem)
 {
     return menuManager.InitializeContextMenu(elem, tabGroupGuid, new GuidObjectsCreator(this, tabGroup));
 }
Exemple #29
0
 public IContextMenuProvider InitializeContextMenu(IMenuService menuService, ITabGroup tabGroup, FrameworkElement elem) => menuService.InitializeContextMenu(elem, tabGroupGuid, new GuidObjectsProvider(this, tabGroup));
Exemple #30
0
 public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return(tabGroup == null ? null : (ToolWindowGroup)tabGroup.Tag);
 }
 /// <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 TabSelectedEventArgs(ITabGroup tabGroup, ITabContent selected, ITabContent unselected)
 {
     this.TabGroup   = tabGroup;
     this.Selected   = selected;
     this.Unselected = unselected;
 }
Exemple #32
0
 public TabGroupContext(ITabGroup tabGroup)
 {
     this.TabGroup        = tabGroup;
     this.TabGroupService = tabGroup.TabGroupService;
 }
 /// <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 TabSelectedEventArgs(ITabGroup tabGroup, ITabContent?selected, ITabContent?unselected)
 {
     TabGroup   = tabGroup;
     Selected   = selected;
     Unselected = unselected;
 }
Exemple #34
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="selected">Selected tab group or null</param>
 /// <param name="unselected">Unselected tab group or null</param>
 public TabGroupSelectedEventArgs(ITabGroup selected, ITabGroup unselected)
 {
     this.Selected   = selected;
     this.Unselected = unselected;
 }
Exemple #35
0
 public MenuTabGroupContext(ITabGroupService tabGroupService)
 {
     TabGroup        = tabGroupService.ActiveTabGroup;
     TabGroupService = tabGroupService;
 }
Exemple #36
0
 public IEnumerable<object> TryRestore(FileTabManager fileTabManager, IFileTabContentFactoryManager creator, ITabGroup g)
 {
     var guid = Content.Attribute<Guid?>(CONTENT_GUID_ATTR);
     if (guid == null)
         yield break;
     var ctx = new GetNodesContext();
     foreach (var o in GetNodes(ctx, fileTabManager.FileTreeView))
         yield return o;
     if (ctx.Nodes == null)
         yield break;
     var tabContent = creator.Deserialize(guid.Value, Content, ctx.Nodes);
     yield return null;
     if (tabContent == null)
         yield break;
     fileTabManager.Add(g, tabContent, null, a => {
         if (a.Success) {
             var uiContext = tabContent.FileTab.UIContext;
             tabContent.FileTab.DeserializeUI(TabUI);
             var obj = uiContext.CreateSerialized(UI);
             uiContext.Deserialize(obj);
         }
     });
     yield return null;
 }
Exemple #37
0
 public TabGroupContext(ITabGroup tabGroup)
 {
     TabGroup        = tabGroup;
     TabGroupService = tabGroup.TabGroupService;
 }
		/// <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 TabSelectedEventArgs(ITabGroup tabGroup, ITabContent selected, ITabContent unselected) {
			this.TabGroup = tabGroup;
			this.Selected = selected;
			this.Unselected = unselected;
		}
			public IContextMenuProvider InitializeContextMenu(IMenuService menuService, ITabGroup tabGroup, FrameworkElement elem) => menuService.InitializeContextMenu(elem, tabGroupGuid, new GuidObjectsProvider(this, tabGroup));
				public GuidObjectsProvider(InitializeContextMenuHelper owner, ITabGroup tabGroup) {
					this.owner = owner;
					this.tabGroup = tabGroup;
				}
Exemple #41
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="selected">Selected tab group or null</param>
 /// <param name="unselected">Unselected tab group or null</param>
 public TabGroupSelectedEventArgs(ITabGroup selected, ITabGroup unselected)
 {
     Selected   = selected;
     Unselected = unselected;
 }
 internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return(ToolWindowGroup.GetToolWindowGroup(tabGroup));
 }
Exemple #43
0
		public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => (ToolWindowGroup)tabGroup?.Tag;
Exemple #44
0
        public static SerializedTabGroup Create(IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g)
        {
            int index = g.TabContents.ToList().IndexOf(g.ActiveTabContent);
            var tg    = new SerializedTabGroup(index);

            foreach (IDocumentTab tab in g.TabContents)
            {
                var t = SerializedTab.TryCreate(documentTabContentFactoryService, tab);
                if (t != null)
                {
                    tg.Tabs.Add(t);
                }
            }

            return(tg);
        }
		/// <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 TabSelectedEventArgs(ITabGroup tabGroup, ITabContent selected, ITabContent unselected) {
			TabGroup = tabGroup;
			Selected = selected;
			Unselected = unselected;
		}
Exemple #46
0
        public IEnumerable <object> Restore(DocumentTabService documentTabService, IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g)
        {
            foreach (var st in Tabs)
            {
                foreach (var o in st.TryRestore(documentTabService, documentTabContentFactoryService, g))
                {
                    yield return(o);
                }
            }
            var ary = g.TabContents.ToArray();

            if ((uint)Index < (uint)ary.Length)
            {
                g.ActiveTabContent = ary[Index];
            }
            yield return(null);
        }
Exemple #47
0
        public IEnumerable <object> TryRestore(FileTabManager fileTabManager, IFileTabContentFactoryManager fileTabContentFactoryManager, ITabGroup g)
        {
            var guid = Content.Attribute <Guid?>(CONTENT_GUID_ATTR);

            if (guid == null)
            {
                yield break;
            }
            var ctx = new GetNodesContext();

            foreach (var o in GetNodes(ctx, fileTabManager.FileTreeView))
            {
                yield return(o);
            }
            if (ctx.Nodes == null)
            {
                yield break;
            }
            var tabContent = fileTabContentFactoryManager.Deserialize(guid.Value, Content, ctx.Nodes);

            yield return(null);

            if (tabContent == null)
            {
                yield break;
            }
            fileTabManager.Add(g, tabContent, null, (Action <ShowTabContentEventArgs>)(a => {
                if (a.Success)
                {
                    var uiContext = tabContent.FileTab.UIContext;
                    tabContent.FileTab.DeserializeUI((ISettingsSection)this.TabUI);
                    var obj = uiContext.CreateSerialized(UI);
                    uiContext.Deserialize(obj);
                }
            }));
            yield return(null);
        }
Exemple #48
0
        public IEnumerable <object> TryRestore(DocumentTabService documentTabService, IDocumentTabContentFactoryService documentTabContentFactoryService, ITabGroup g)
        {
            var guid = Content.Attribute <Guid?>(CONTENT_GUID_ATTR);

            if (guid == null)
            {
                yield break;
            }
            var ctx = new GetNodesContext();

            foreach (var o in GetNodes(ctx, documentTabService.DocumentTreeView))
            {
                yield return(o);
            }
            if (ctx.Nodes == null)
            {
                yield break;
            }
            var tabContent = documentTabContentFactoryService.Deserialize(guid.Value, Content, ctx.Nodes);

            yield return(null);

            if (tabContent == null)
            {
                yield break;
            }
            documentTabService.Add(g, tabContent, null, (Action <ShowTabContentEventArgs>)(a => {
                if (a.Success)
                {
                    var uiContext = tabContent.DocumentTab.UIContext;
                    tabContent.DocumentTab.DeserializeUI((ISettingsSection)TabUI);
                    var obj = uiContext.DeserializeUIState(UI);
                    uiContext.RestoreUIState(obj);
                }
            }));
            yield return(null);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="added">true if it was added</param>
 /// <param name="tabGroup">Tab group</param>
 public TabGroupCollectionChangedEventArgs(bool added, ITabGroup tabGroup)
 {
     Added    = added;
     TabGroup = tabGroup;
 }
 internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return ToolWindowGroup.GetToolWindowGroup(tabGroup);
 }