コード例 #1
0
 public void Initialize()
 {
     Task.Run(() =>
     {
         foreach (var file in Flatten().Where(IsRootLevelDocument))
         {
             _Documents.AddOrUpdate(file, f => DocumentManager.Get(f), (f, d) => d);
         }
     });
 }
コード例 #2
0
        ISassEditor Create(ITextBuffer buffer)
        {
            ITextDocument document;

            if (buffer.Properties.TryGetProperty(typeof(ITextDocument), out document))
            {
                var sassDocument = DocumentManager.Get(new FileInfo(document.FilePath));
                var cache        = IntellisenseManager.Get(sassDocument);
                return(new SassEditor(buffer, sassDocument, cache, ParsingTask));
            }

            return(null);
        }
コード例 #3
0
        public ActionResult DeleteDoc(long id, string originalFileName)
        {
            var document = documentManager.Get(id) as Document;

            if (document == null)
            {
                PartialView("Documents");
            }

            documentManager.Delete(document);

            var fullPath = Request.MapPath("~/Files/" + originalFileName);

            if (System.IO.File.Exists(fullPath))
            {
                System.IO.File.Delete(fullPath);
            }

            return(PartialView("Documents", documentManager.GetList()));
        }