public void FormatDocument(Document doc)
        {
            try
            {
                var cfg = getExtensionCfg();
                var filter = new AllowDenyDocumentFilter(cfg.Allowed.Split(' '), cfg.Denied.Split(' '));

                formatter.Format(doc, filter);
            }
            catch (Exception) { }   // Do not do anything here on purpose.
        }
示例#2
0
        public void FormatDocument(Document doc)
        {
            if (ShouldFormat(doc) == false)
            {
                return;
            }

            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.
        }