3

Is there a Silverlight control out there that will allow you to type in text and have it highlighted as code?

For example:

foreach (client in Clients)
{
   client.Save();
}

would become

foreach (client in Clients)
{
   client.Save();
}

I need to write a web app to screen non-programming programmers without wasting time on them one by one. I am thinking of a Silverlight app that will ask a few simple programming questions with a time limit. After the limit is up, it will send what they have via a web service.

Most of that is quite doable for me, but I would like to be able offer my candidates code highlighting. I am not up to (nor interested in) writing a Silverlight code highlighter.

Any suggestions?

iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
Vaccano
  • 78,325
  • 149
  • 468
  • 850
  • This question might be of interest: http://stackoverflow.com/questions/411913/silverlight-xml-editor-syntax-highlighting – andyp Jul 15 '10 at 21:41
  • Oh, and look at http://www.coderproof.com/ – andyp Jul 15 '10 at 21:44
  • @andyp - coderproof looks nice, but I am looking for (and writing) something much less interactive. The idea is to just have them do the questions (in a time limit) and submit the result. Then we can evaluate them (and then can take the test) when we (they) have time. – Vaccano Jul 21 '10 at 17:30

2 Answers2

4

Actipro Software has a syntax highlighter component for Silverlight, WPF, and Winforms:

http://www.actiprosoftware.com/

Chad Brockman
  • 1,176
  • 3
  • 10
  • 19
1

In Silverlight4 you could use the RichTextArea control.

The link below has some info on this control: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/11/18/silverlight-4-rough-notes-richtextarea.aspx

Still in Silverlight 4 you can also use the HTML brush.

In Silverlight 3 you can also show HTML but using a third party control. The one below is free. http://www.divelements.co.uk/silverlight/tools.aspx

There are also those articles on syntax highlighting:

http://www.sharpgis.net/post/2010/06/06/Code-Syntax-Highlighting-in-Silverlight.aspx http://www.jeff.wilcox.name/2010/03/syntax-highlighting-text-block/ http://community.devexpress.com/blogs/theprogressbar/archive/2010/05/12/silverlight-rich-text-edit-control-custom-syntax-highlighting.aspx
Klinger
  • 4,900
  • 1
  • 30
  • 35