internal static IDsDocument[] OpenDocuments(IDocumentTreeView documentTreeView, Window ownerWindow, IEnumerable<string> filenames, bool selectDocument = true) { var documentLoader = new DsDocumentLoader(documentTreeView.DocumentService, ownerWindow); var loadedDocuments = documentLoader.Load(filenames.Select(a => new DocumentToLoad(DsDocumentInfo.CreateDocument(a)))); var document = loadedDocuments.Length == 0 ? null : loadedDocuments[loadedDocuments.Length - 1]; if (selectDocument && document != null) { Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { var node = documentTreeView.FindNode(document); if (node != null) documentTreeView.TreeView.SelectItems(new[] { node }); })); } return loadedDocuments; }
internal static IDsDocument[] OpenDocuments(IDocumentTreeView documentTreeView, Window ownerWindow, AssemblyExplorerMostRecentlyUsedList mruList, IEnumerable <string> filenames, bool selectDocument = true) { var documentLoader = new DsDocumentLoader(documentTreeView.DocumentService, ownerWindow, mruList); var loadedDocuments = documentLoader.Load(filenames.Select(a => new DocumentToLoad(DsDocumentInfo.CreateDocument(a)))); var document = loadedDocuments.Length == 0 ? null : loadedDocuments[loadedDocuments.Length - 1]; if (selectDocument && document is not null) { Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { var node = documentTreeView.FindNode(document); if (node is not null) { documentTreeView.TreeView.SelectItems(new[] { node }); } })); } return(loadedDocuments); }