public void FollowReferenceNewTab(object @ref, Action <ShowTabContentEventArgs> onShown) { var tab = DocumentTabService.OpenEmptyTab(); tab.FollowReference(@ref, Content, onShown); DocumentTabService.SetFocus(tab); }
public void TrySetFocus() { if (IsActiveTab) { DocumentTabService.SetFocus(this); } }
public ReloadAllHelper(DocumentTabService documentTabService) { this.documentTabService = documentTabService; originalDocuments = new HashSet <IDsDocument>(documentTabService.DocumentTreeView.DocumentService.GetDocuments(), new DsDocumentComparer()); old_disable_DocumentCollectionChanged = documentTabService.disable_DocumentCollectionChanged; documentTabService.disable_DocumentCollectionChanged = true; }
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); }
DocumentListLoader(IAppWindow appWindow, DocumentListService documentListService, DocumentTabService documentTabService, DocumentTabSerializer documentTabSerializer, [ImportMany] IEnumerable <Lazy <IDocumentListListener, IDocumentListListenerMetadata> > documentListListeners) { this.documentListService = documentListService; this.documentTabService = documentTabService; this.documentTabSerializer = documentTabSerializer; this.documentListListeners = documentListListeners.OrderBy(a => a.Metadata.Order).ToArray(); appWindow.MainWindowClosed += AppWindow_MainWindowClosed; }
public void TrySetFocus() { if (removed) { return; } if (IsActiveTab) { DocumentTabService.SetFocus(this); } }
public void FollowReferenceNewTab(object @ref, Action <ShowTabContentEventArgs> onShown) { if (NotifyReferenceHandlers(@ref, Content, onShown)) { return; } var tab = (TabContentImpl)DocumentTabService.OpenEmptyTab(); tab.FollowReferenceCore(@ref, Content, onShown); DocumentTabService.SetFocus(tab); }
public TabContentImpl(DocumentTabService documentTabService, IDocumentTabUIContextLocator documentTabUIContextLocator, Lazy <IReferenceDocumentTabContentProvider, IReferenceDocumentTabContentProviderMetadata>[] referenceDocumentTabContentProviders, Lazy <IDefaultDocumentTabContentProvider, IDefaultDocumentTabContentProviderMetadata>[] defaultDocumentTabContentProviders) { this.elementZoomer = new TabElementZoomer(); this.tabHistory = new TabHistory(); this.tabHistory.SetCurrent(new NullDocumentTabContent(), false); this.documentTabService = documentTabService; this.documentTabUIContextLocator = documentTabUIContextLocator; this.referenceDocumentTabContentProviders = referenceDocumentTabContentProviders; this.defaultDocumentTabContentProviders = defaultDocumentTabContentProviders; this.uiContext = new NullDocumentTabUIContext(); this.uiObject = this.uiContext.UIObject; }
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); }
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); }
public void Close() => DocumentTabService.Close(this);
DocumentTabSerializer(IDocumentTabContentFactoryService documentTabContentFactoryService, DocumentTabService documentTabService) { this.documentTabContentFactoryService = documentTabContentFactoryService; this.documentTabService = documentTabService; }
DocumentTabServiceLoader(DocumentTabSerializer documentTabSerializer, DocumentTabService documentTabService, IDocumentListLoader documentListLoader) { this.documentTabSerializer = documentTabSerializer; this.documentTabService = documentTabService; this.documentListLoader = documentListLoader; }