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

            tabGroup.Add(impl);
            return(impl);
        }
Esempio n. 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);
        }
Esempio n. 6
0
        TabContentImpl CreateNewTab(ITabGroup tabGroup)
        {
            var impl = new TabContentImpl(this, documentTabUIContextLocatorProvider.Create(), referenceDocumentTabContentProviders, defaultDocumentTabContentProviders, referenceHandlers);

            tabGroup.Add(impl);
            return(impl);
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
        TabContentImpl CreateNewTab(ITabGroup tabGroup)
        {
            var impl = new TabContentImpl(this, fileTabUIContextLocatorProvider.Create(), referenceFileTabContentProviders, defaultFileTabContentProviders);

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

            g.ActiveTabContent = impl;
            return(impl);
        }
Esempio n. 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;
		}
Esempio n. 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();
        }
Esempio n. 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;
		}
Esempio n. 13
0
 public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return tabGroup == null ? null : (ToolWindowGroup)tabGroup.Tag;
 }
Esempio n. 14
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;
		}
Esempio n. 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);
        }
Esempio n. 16
0
 public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => (ToolWindowGroup)tabGroup?.Tag;
Esempio n. 17
0
		public ToolWindowGroup(IToolWindowGroupService toolWindowGroupService, ITabGroup tabGroup) {
			ToolWindowGroupService = toolWindowGroupService;
			TabGroup = tabGroup;
			TabGroup.Tag = this;
			TabGroup.TabContentAttached += TabGroup_TabContentAttached;
		}
Esempio n. 18
0
 internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => ToolWindowGroup.GetToolWindowGroup(tabGroup);
Esempio n. 19
0
		internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => ToolWindowGroup.GetToolWindowGroup(tabGroup);
Esempio n. 20
0
 public GuidObjectsProvider(InitializeContextMenuHelper owner, ITabGroup tabGroup)
 {
     this.owner    = owner;
     this.tabGroup = tabGroup;
 }
Esempio n. 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();
 }
Esempio n. 22
0
 public bool Owns(ITabGroup tabGroup) => TabGroupService.TabGroups.Contains(tabGroup);
Esempio n. 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;
		}
Esempio n. 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;
		}
Esempio n. 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;
		}
Esempio n. 28
0
 public IContextMenuCreator InitializeContextMenu(IMenuManager menuManager, ITabGroup tabGroup, FrameworkElement elem)
 {
     return menuManager.InitializeContextMenu(elem, tabGroupGuid, new GuidObjectsCreator(this, tabGroup));
 }
Esempio n. 29
0
 public IContextMenuProvider InitializeContextMenu(IMenuService menuService, ITabGroup tabGroup, FrameworkElement elem) => menuService.InitializeContextMenu(elem, tabGroupGuid, new GuidObjectsProvider(this, tabGroup));
Esempio n. 30
0
 public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return(tabGroup == null ? null : (ToolWindowGroup)tabGroup.Tag);
 }
Esempio n. 31
0
 /// <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;
 }
Esempio n. 32
0
 public TabGroupContext(ITabGroup tabGroup)
 {
     this.TabGroup        = tabGroup;
     this.TabGroupService = tabGroup.TabGroupService;
 }
Esempio n. 33
0
 /// <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;
 }
Esempio n. 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;
 }
Esempio n. 35
0
 public MenuTabGroupContext(ITabGroupService tabGroupService)
 {
     TabGroup        = tabGroupService.ActiveTabGroup;
     TabGroupService = tabGroupService;
 }
Esempio n. 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;
 }
Esempio n. 37
0
 public TabGroupContext(ITabGroup tabGroup)
 {
     TabGroup        = tabGroup;
     TabGroupService = tabGroup.TabGroupService;
 }
Esempio n. 38
0
		/// <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;
		}
Esempio n. 39
0
			public IContextMenuProvider InitializeContextMenu(IMenuService menuService, ITabGroup tabGroup, FrameworkElement elem) => menuService.InitializeContextMenu(elem, tabGroupGuid, new GuidObjectsProvider(this, tabGroup));
Esempio n. 40
0
				public GuidObjectsProvider(InitializeContextMenuHelper owner, ITabGroup tabGroup) {
					this.owner = owner;
					this.tabGroup = tabGroup;
				}
Esempio n. 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;
 }
Esempio n. 42
0
 internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return(ToolWindowGroup.GetToolWindowGroup(tabGroup));
 }
Esempio n. 43
0
		public static ToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup) => (ToolWindowGroup)tabGroup?.Tag;
Esempio n. 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);
        }
Esempio n. 45
0
		/// <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;
		}
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
 }
Esempio n. 50
0
 internal IToolWindowGroup GetToolWindowGroup(ITabGroup tabGroup)
 {
     return ToolWindowGroup.GetToolWindowGroup(tabGroup);
 }