This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How Is Syntax Highlighting Built?
I'm writing in C#. I have a simple RichTextBox, In which I'm writing in LaTeX.
Question:
How can I add LaTeX syntax highlighting in the box, so when I'm writing (in LaTeX syntax) the text will be highlighted?
RichTextBox does not natively support syntax highlighting. You will have to write your own or build on an existing one.
Related
This question already has answers here:
Is there a way to implement custom language features in C#?
(6 answers)
Closed 6 years ago.
I'm writing a library for personal use that greatly expands C# features, and I was wondering on something quite interesting... Is it possible to create you own keywords? For example, if, foreach, for etc.
The reason I want to do this can be found at my previous question.
No, you can not do that. Language keywords are defined in the language definition. You could probably use the open sourced parts (compilers, etc) and create your own version of them.
This question already has answers here:
Visual Studio: Export C# Code into a PDF file and keep the formatting + colors?
(4 answers)
Closed 6 years ago.
I have a code that I need to put in a document for my coursework but I would like to keep all the formatting and line numbers. Is there any way of doing that?
Copy and paste it.
Ms Word will retain the formatting.
Other text editors might as well.
This question already has answers here:
C# hide and unhide comments
(6 answers)
Closed 9 years ago.
I am using the C# XML style of documentation in my latest project (eg using ///<summary> stuff). I find this makes the source code a pain to read as it just becomes so long. Is there a way in Visual Studio to auto-collapse just these or do I have to use the collapse to definitions and re-expand functions?
Take a look here at the following post, I think it should help
http://www.helixoft.com/blog/archives/30?n=collapse-all-xml-comments-in-vb-net-or-c
This question already has answers here:
Is there a CSS parser for C#? [closed]
(6 answers)
Closed 9 years ago.
I'm searching for a function (perhaps there is one in the .Net-Framework) which I can use to validate CSS-syntax for different version (CSS 3.0, 2.0). It can also be a CSS parser with build-in validation. Any suggestions for a library or tool that i can use?
take a look at ExCSS, it can parse CSS 2.1 and CSS 3,
https://github.com/TylerBrinks/ExCSS
for validation, try regex,
try this pattern /([A-Za-z0-9 ]+:[A-Za-z0-9 ]+;$)+/i
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Silverlight XML editor / syntax highlighting
Hello,
I have some XML in my Silverlight Application that I store in a String and wish to output to the user. The xml is already "pretty printed" in the sense that it is formatted with indentations, but it would make it much clearer to read if I could also add syntax colouring to it.
Can this be done? How do I go about doing it? (please suggest a library or something)
Come to think of it, I'm not even sure if it's at all possible to output coloured text in a .NET interface...
Thank you for any insight!
(PS: I don't care which version of Silverlight)
I looked and did not find a control that would do XML syntax highlighting for a WinForms RichTextBox. This was for an XPath evaluator tool I built. The WinForms RichTextBox has the capability to display colors of course, but I couldn't find one smart enough to highlight XML syntax.
I ended up building one. The approach I used would probably work for WPF as well.
This is the explanation for how I got there:
WinForms RichTextBox : how to reformat asynchronously, without firing TextChanged event