private void OnPathFound(string dotFile) { if (!File.Exists(dotFile)) { MessageBox.Show("No paths found"); return; } myDocumentLoader.Load(dotFile); }
public async Task <IDocument> OpenDocument(string fileName, string loaderHint = "") { if (!File.Exists(fileName)) { return(null); } if (IsOpen(fileName)) { ActivateDocument(GetDocumentByFileName(fileName)); return(null); } IDocumentLoader loader = null; if (!String.IsNullOrWhiteSpace(loaderHint)) { loader = _loaders.FirstOrDefault(x => x.GetType().Name == loaderHint); } if (loader == null) { loader = _loaders.FirstOrDefault(x => x.CanLoad(fileName)); } if (loader != null) { var doc = await loader.Load(fileName); if (doc != null) { OpenDocument(doc); } return(doc); } return(null); }