コード例 #1
0
        public string Format(string Document, string HighlighterName, bool IncludeLineNumbers)
        {
            HtmlWriter writer = new HtmlWriter();
            writer.ShowLineNumbers = IncludeLineNumbers;
            writer.AlternateLineBackground = false;

            string generatedHtml = writer.GenerateHtml(Document, HighlighterName);
            return "<html><body>" + generatedHtml + "</body></html>";
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: kingjiang/SharpDevelopLite
		public static void Main(string[] args)
		{
			HtmlWriter w = new HtmlWriter();
			w.ShowLineNumbers = true;
			w.AlternateLineBackground = true;
			string code = File.ReadAllText("../../Main.cs");
			string html = w.GenerateHtml(code, "C#");
			File.WriteAllText("output.html", "<html><body>" + html + "</body></html>");
			Process.Start("output.html"); // view in browser
		}
コード例 #3
0
ファイル: Main.cs プロジェクト: prid77/TickZoomPublic
        public static void Main(string[] args)
        {
            HtmlWriter w = new HtmlWriter();

            w.ShowLineNumbers         = true;
            w.AlternateLineBackground = true;
            string code = File.ReadAllText("../../Main.cs");
            string html = w.GenerateHtml(code, "C#");

            File.WriteAllText("output.html", "<html><body>" + html + "</body></html>");
            Process.Start("output.html");             // view in browser
        }
コード例 #4
0
ファイル: Main.cs プロジェクト: 2594636985/SharpDevelop
		public static void Main(string[] args)
		{
			IHighlightingDefinition highlightDefinition = HighlightingManager.Instance.GetDefinition("C#");
			
			HtmlWriter w = new HtmlWriter();
			w.ShowLineNumbers = true;
			w.AlternateLineBackground = true;
			string code = File.ReadAllText("../../Main.cs");
			string html = w.GenerateHtml(code, highlightDefinition);
			File.WriteAllText("output.html", "<html><body>" + html + "</body></html>");
			Process.Start("output.html"); // view in browser
		}
コード例 #5
0
        protected void formatCode_Click(object sender, EventArgs e)
        {
            HtmlWriter writer = new HtmlWriter();
            writer.ShowLineNumbers = ShowLineNumbers.Checked;
            writer.AlternateLineBackground = UseAlternatingBackground.Checked;

            string generatedHtml = writer.GenerateHtml(inputTextBox.Text, languageChoice.SelectedValue);

            string codeHtmlDocument = "<html><body>" + generatedHtml + "</body></html>";
            outputTextBox.Text = codeHtmlDocument;
            inlineCodePreview.Text = generatedHtml;
            PreviewPane.Visible = true;
        }
コード例 #6
0
ファイル: Main.cs プロジェクト: ElinamLLC/SharpDeveloper
        public static void Main(string[] args)
        {
            IHighlightingDefinition highlightDefinition = HighlightingManager.Instance.GetDefinition("C#");

            HtmlWriter w = new HtmlWriter();

            w.ShowLineNumbers         = true;
            w.AlternateLineBackground = true;
            string code = File.ReadAllText("../../Main.cs");
            string html = w.GenerateHtml(code, highlightDefinition);

            File.WriteAllText("output.html", "<html><body>" + html + "</body></html>");
            Process.Start("output.html");             // view in browser
        }
コード例 #7
0
ファイル: Main.cs プロジェクト: MikeHook/HtmlSyntaxColorizer
        public static void Main(string[] args)
        {
            IHighlightingDefinition highlightDefinition = null;
            var _assembly = Assembly.GetExecutingAssembly();
            using (Stream s = File.OpenRead("GherkinDefinition.xshd"))
            {
                using (XmlTextReader reader = new XmlTextReader(s))
                {
                    highlightDefinition = HighlightingLoader.Load(reader, HighlightingManager.Instance);
                }
            }

            HtmlWriter w = new HtmlWriter();
            w.ShowLineNumbers = false;
            w.CreateStylesheet = false;
            w.AlternateLineBackground = false;
            string code = File.ReadAllText("../../SampleFeature.txt");
            string html = w.GenerateHtml(code, highlightDefinition);
            File.WriteAllText("output.html", "<html><body>" + html + "</body></html>");
            Process.Start("output.html"); // view in browser
        }