views:

164

answers:

2

Hi all,

I've searched the web and I can't seem to find anything that will work for me. I've seen plenty of discussion, and even some fairly extensible open-source tools, for code editors that provide line numbers and syntax highlighting.

Here's my dilemma...

I'm working on a "digital code review" project in C#.NET that allows users to specify source files, add them to a particular session, and other users can make comments and line references to the files being reviewed.

Basic requirements:

  • Must be written in C#.NET
  • I don't need to be able to edit the text in the text box
  • Users need to be able to select a line (or multiple lines), to make line references.

It seems to me that I need some fancy implementation of a ListBox control (not a drop-down list) that has some OwnerDraw capabilities to add line numbers and syntax highlighting. Unfortunately, I haven't had any luck putting it together myself, and I can't seem to find a control that's already been written or a reference on how I might be able to accomplish this.

Any suggestions??

A: 

I suggest to try ScintillaNet. It has syntax highlight and line numbers (and so much more). However you cannot select more lines only one selection at the time.

Biri
A: 

I would use a text box control for this, just make it read only and put the line numbers in when you load it. Just a quick question, when you say:

Users need to be able to select a line (or multiple lines), to make line references.

Is this in a web app? How do the users indicate that they want to create a reference (some button somewhere?). Easier to do on windows with a context menu. Where does the user reference to the code go, how does it appear to other users viewing the code?

Decker97
I started out making a web app, but I'm not much of a web programmer, so I couldn't quite get the hang of it, so I opted to write it up as a Windows application in C#.NET.Currently, the code is displayed in a ListBox, and reviewers are able to type in a comment (in a separate TextBox), make line references to the source file by selecting one or more items in the ListBox, and click an "Add Comment" button when they're done.All this information is stored in a SQL Server database, and reviewers can view all the comments that have been added by other users.
ph0enix