示例#1
0
        public static ScriptFormatter CreatePlainTextFormatter()
        {
            ScriptFormatter toReturn = new ScriptFormatter();

            toReturn.open = "";
            toReturn.close = "";

            toReturn.newLine = "\n";
            toReturn.indent = "  ";
            toReturn.singleSpace = " ";
            toReturn.openBracket = "<";
            toReturn.closeBracket = ">";

            toReturn.openElementFormat = "";
            toReturn.closeElementFormat = "";

            toReturn.openAttributeName = "";
            toReturn.closeAttributeName = "";

            toReturn.openValue = "";
            toReturn.closeValue = "";

            toReturn.openComment = toReturn.openBracket + "!--" + toReturn.singleSpace;
            toReturn.closeComment = toReturn.singleSpace + "--" + toReturn.closeBracket;

            return toReturn;
        }
示例#2
0
        private static ScriptFormatter CreateHtmlFormatter()
        {
            ScriptFormatter toReturn = new ScriptFormatter();

            toReturn.open = "<span style=\"color:blue; font-family : monospace; white-space:nowrap;\" >";
            toReturn.close = "</span>";

            toReturn.newLine = "<br />";
            toReturn.indent = "&nbsp;&nbsp;";
            toReturn.singleSpace = "&nbsp;";
            toReturn.openBracket = "&lt;";
            toReturn.closeBracket = "&gt;";

            toReturn.openElementFormat = "<span style=\"color:maroon\" >";
            toReturn.closeElementFormat = "</span>";

            toReturn.openAttributeName = "<span style=\"color:red\">";
            toReturn.closeAttributeName = "</span>";

            toReturn.openValue = "<span style=\"color:black\" ><b>";
            toReturn.closeValue = "</b></span>";

            toReturn.openComment = "<span style=\"font-style:italic; color:grey;\">&lt;!--" + toReturn.singleSpace;
            toReturn.closeComment = toReturn.singleSpace + "--&gt;</span>";

            return toReturn;
        }