Click here to Skip to main content
13,867,210 members
Click here to Skip to main content
Add your own
alternative version

Stats

26.4K views
510 downloads
14 bookmarked
Posted 17 Apr 2009
Licenced CPOL

Code Colorizer with Silverlight 2 & C#

, 5 May 2009
Rate this:
Please Sign up or sign in to vote.
Colorize C# & VB codes

Introduction

CodeColorizer is a Silverlight 2 application to colorize codes for using in web logs or websites.
You can colorize C# and VB codes.
CodeColorizer generates valid XHTML codes, but if you're using some codes with syntax errors, probably it causes generating invalid XHTML codes.

Using the Application

Before using: If you're writing something in arbitrary CSS class name's textbox, you have to define it in your CSS codes.
For example, I recommend the following CSS class:

<style type="text/css">
<!--
.pre{
	font: 400 12px consolas,'Courier New',courier,monospace;
	width:100%; 
	margin: 0; 
	min-height: 1.2em; 
	direction:ltr;
}
-->
</style>

Using this option causes CodeColorizer to generate a shorter code.

Let's see some results of the application:

  • Striped = false;
  • C# = true;
  • Line Numbers = false;
  • Add the default Styles within Pre tags = true;
  • Add Pre Tags = true;
  • Add background color to the pre tag = true;
  • TextBoxColor = "ffecd0";

  • Striped = true;
  • C# = true;
  • Line Numbers = false;
  • Add the default Styles within Pre tags = true;

  • Striped = true;
  • C# = true;
  • Line Numbers = true;
  • Add the default Styles within Pre tags = true;

Finally

Probably there are some bugs or errors in the application. I would appreciate if you post them. Thanks!

History

  • 18th April, 2009: First post
  • 21st April, 2009: Updated demo and source files
  • 5th May, 2009: Updated demo and source files

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mohammad Dayyan
Iran (Islamic Republic of) Iran (Islamic Republic of)
No Biography provided

You may also be interested in...

Pro

Comments and Discussions

 
SuggestionOnline C# Code Colorizer Pin
Pavel Vladov27-Aug-12 1:21
memberPavel Vladov27-Aug-12 1:21 
GeneralColoriser's use in web pages Pin
Dmitri Nеstеruk18-Apr-09 18:17
memberDmitri Nеstеruk18-Apr-09 18:17 
GeneralRe: Coloriser's use in web pages Pin
Mohammad Dayyan19-Apr-09 2:38
memberMohammad Dayyan19-Apr-09 2:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190214.1 | Last Updated 5 May 2009
Article Copyright 2009 by Mohammad Dayyan
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid