public void FormatDocument(Document doc)
 {
     try
     {
         formatter.Format(doc);
     }
     catch (Exception e)
     {
     }             // Do not do anything here on purpose.
 }
        public override int OnBeforeSave(uint docCookie)
        {
            var document = locator.FindDocument(docCookie);

            if (document != null)
            {
                formatter.Format(document);
            }

            return(VSConstants.S_OK);
        }
        public void FormatDocument(Document doc)
        {
            try
            {
                var cfg    = getGeneralCfg(doc);
                var filter = new AllowDenyDocumentFilter(cfg.Allowed, cfg.Denied);

                formatter.Format(doc, filter, cfg.Command);
            }
            catch (Exception) { }   // Do not do anything here on purpose.
        }
Beispiel #4
0
        public void FormatDocument(Document doc)
        {
            try
            {
                var cfg    = getGeneralCfg(doc);
                var filter = new AllowDenyDocumentFilter(cfg.Allowed, cfg.Denied);

                foreach (string splitCommand in cfg.Commands.Trim().Split(' '))
                {
                    try
                    {
                        string commandName = splitCommand.Trim();
                        formatter.Format(doc, filter, commandName);
                    }
                    catch (Exception) { }   // may be we can log which command has failed and why
                }
            }
            catch (Exception) { }   // Do not do anything here on purpose.
        }