Exemplo n.º 1
0
 public void OpenDocument(Editor doc, string filename)
 {
     doc.OpenFile(filename);
     //TODO: do this on different threads
     projectService.CurrentProject.ParserService.ParseFile(filename, doc.editor.Text);
     //handle recent file stuff
     recentFileService.AddRecentFile(filename);
     recentFileService.SaveRecentFileList();
     recentFileService.GetRecentFiles();
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Post([FromForm] CatalogViewModel catalogAdded)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid posted data."));
            }

            try
            {
                var catalogName = HttpUtility.UrlDecode(catalogAdded.Name);
                var documentId  = HttpUtility.UrlDecode(catalogAdded.DocumentId);
                return(Ok(await _recentFileService.AddRecentFile(new SourceCatalog()
                {
                    Name = catalogName, DocumentId = documentId
                })));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.ToString()));
            }
        }