Beispiel #1
0
 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;
 }
		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;
		}
		DocumentTabSerializer(IDocumentTabContentFactoryService documentTabContentFactoryService, DocumentTabService documentTabService) {
			this.documentTabContentFactoryService = documentTabContentFactoryService;
			this.documentTabService = documentTabService;
		}
Beispiel #4
0
		public TabContentImpl(DocumentTabService documentTabService, IDocumentTabUIContextLocator documentTabUIContextLocator, Lazy<IReferenceDocumentTabContentProvider, IReferenceDocumentTabContentProviderMetadata>[] referenceDocumentTabContentProviders, Lazy<IDefaultDocumentTabContentProvider, IDefaultDocumentTabContentProviderMetadata>[] defaultDocumentTabContentProviders, Lazy<IReferenceHandler, IReferenceHandlerMetadata>[] referenceHandlers) {
			elementZoomer = new TabElementZoomer();
			tabHistory = new TabHistory();
			tabHistory.SetCurrent(new NullDocumentTabContent(), false);
			this.documentTabService = documentTabService;
			this.documentTabUIContextLocator = documentTabUIContextLocator;
			this.referenceDocumentTabContentProviders = referenceDocumentTabContentProviders;
			this.defaultDocumentTabContentProviders = defaultDocumentTabContentProviders;
			this.referenceHandlers = referenceHandlers;
			uiContext = new NullDocumentTabUIContext();
			uiObject = uiContext.UIObject;
		}
		DocumentTabServiceLoader(DocumentTabSerializer documentTabSerializer, DocumentTabService documentTabService, IDocumentListLoader documentListLoader) {
			this.documentTabSerializer = documentTabSerializer;
			this.documentTabService = documentTabService;
			this.documentListLoader = documentListLoader;
		}
Beispiel #6
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;
		}
Beispiel #7
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;
		}
Beispiel #8
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;
		}