A textbox/richtextbox that has syntax highlighting? [C#] [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Where can I find a control for WinForms that will highlight source code pasted into it? I would like one that has syntax highlighting support for many different languages but if it only works with C# I would be fine with that also.

Scintilla.NET is probably what you're looking for

Just recently have found a nice control from codeproject Fast Colored TextBox for syntax highlighting.
The only issue with using Rich Text Box as highlighter is slow performance on coloring, in cases when the size of the document is big. For a medium size documents this issue can be fixed by delayed highlighting.

As Open Source alternatives, give a look to:
dotNetFireball
ICSharpCode.TextEditor from SharpDevelop

Add ICSharpCode.TextEditor assembly reference to a project, choose assembly and controls for Visual Studio Toolbox. After that, you can put control to the Form. Surprisingly, you will not see Property to choose syntax highlight schema. Instead of this, you have to use method SetHighlighting. String parameter sets highlighting schema from available schemas list. These schemas are embedded into the control.
How to use, change schemas and download sample, look following article

If you're willing to pay for a control, I highly recommend this one: QWhale Syntax Edit. It's got a ton of features, comes with source code, and supports a lot of languages. I use it myself for C#, VB.NET, SQL (MS & Oracle), and it's got everything that VS provides.

Not sure if there is any out of the box non-thirdparty solution to this.
But, have you looked at Actipro SyntaxEditor component. LinqPad, the ubercool linq tool uses it for syntax highlighting and intellisense.

Check out the AvalonEdit control. There is a good article on CodeProject explaining how to use it.

you can try this http://www.codeproject.com/KB/edit/SyntaxHighlighting.aspx

Related

Creating charts in Blazor [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
So basically I want to create charts with server-side blazor, I was searching around for some packages which would allow me to create charts. The problem being that they are all pretty expensive:
telerik
syncfusion
The only free alternative which is also pretty good I found was ofc. ChartJs, but it uses obviusly js which is not really the direction I wanted to go for.
So are there any 'good' Blazor chart libraries which are free and let me create the normal hand full of chart types e.g. area-charts, line charts, bar charts ... ?
To answer the question myself, this is the library which looks the most promising and it is also free.
There is also a specific ChartJS.Blazor package available for free, just a small NuGet package. And compatible with client-side and server-side Blazor applications.
ChartJS.Blazor package by Marius Muntean
Or search for "ChartJS.Blazor" in NuGet Package manager in Visual Studio
Note: The . is after ChartJS and before Blazor, not after Chart directly. Otherwise you won't find this package but all the other variations.
Plotly.Blazor is now another option.
Plotly.Blazor is a wrapper for plotly.js.
Built on top of d3.js and stack.gl, plotly.js is a high-level, declarative charting library. It ships with over 40 chart types, including 3D charts, statistical graphs, and SVG maps.
plotly.js is free and open source and you can view the source, report issues or contribute on GitHub.
There are beautiful charts available on Blazorise.com. Please check them and give a try:
https://bootstrapdemo.blazorise.com/tests/charts
There is also Blazly even though it doesn't seem to be much activity lately it is quite easy to adapt to specific needs.
You can find the library for bar chart, and lot of other components here:
radzen.com

How to make a custom text editor [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How would one go about making a custom text editor? I am thinking of a visual studio- like editor where things other than text can appear within the text area, such as drop-down menus, buttons images etc.
For example,
This sentence is __ a word.
I need to be able to click the "__" and have a dropdown or window open in its place, much like visual studio allows you to select functions of classes and have some things auto filled in for you.
To my knowledge, this can not be achieved conventionally in windows forms or wpf. How would you go about this?
I have C#, C++ and Java knowledge and would like to make this a native application.
If you would like to do it in C++, you could look at the source code of Notepad++. It's a text editor written around the Scintilla editing component. It supports features such as auto-complete/tab-complete, function parameter hints, etc. It sounds like you want to do something similar, so I would say looking at the source code of Notepad++ would be a good place to start.
Note: As mentioned in some comments above, this is one way to go about it. There are other libraries like Scintilla, and also other ways of doing this. This is just the first one I thought of.
Okay, here are some other ideas. You might look at using Eclipse's text editing component (Java). You could also look at what SharpDevelop or MonoDevelop use (C#). Look around at various open-source text editors and see how they do it.
I have some experience of developing text editors and would like to share the same here . However mine has been on Java but still might help you take the decision . Well you havent really said if you are making the text editor for an any existing language or a new language.
My text editor was for a customized language . Hence i had to write the grammar of the language and only then make the text editor for that . To do so I used Xtext framework which is very useful for developing customized langauges and the tools like editors for the same . It has good support for the following
i) Syntax highlighting
ii) Dropdown buttons with content assists
iii) Excellent java integration
iv) Excellent IDE support as it can be installed as an eclipse plugin .
However it might be an overkill if you do it just for plain text editor ! ! !
Xtext official documentation

Auto-generate documentation for single c# file in asp.net project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm trying to figure out how to automatically generate documentation for a single c# file in an ASP.NET project. I'm using VS 2010, and I have SandCastle, but I'm starting to get the impression it can only be used for a full project. The problem is that our entire project is huge and nothing but that one file needs documentation (it's the only one with functionality our clients use - everything else is internal)
I could do a batch script, but I'd rather not if there's a better way of going about this!
Does anybody have any ideas? Thanks very much in advance!
(as a side note, I saw this already and it did not help: Generating XML Documentation for single VB Class in WebSite Project )
I recommend using Sandcastle.
http://shfb.codeplex.com/
One thing you could do is have a post build task that pulls that portion of XML from the documentation file and then run Sandcastle or doxygen against your new XML file.
Have you tried StyleCop? It's aimed more at ensuring consistent coding practices, but does provide a little handy tool that allows you to quickly "Document this" on a constructor, method or property, etc. Might be worth a look to see if it's what you're after.
StyleCop
You can try https://www.docify.net/. Their whole thing is exactly this.
I've recently made a simple to use library that generates markdown documentation from C# code. All it takes is a class library dll file.
If you want to give it a try, here's a link on how to start using it with examples of generated documentation.
More informations : https://www.nuget.org/packages/BetaSoftware.AutoDocumentation
Doxygen might help. http://www.doxygen.nl/
At very least you can generate a word or pdf doc and then make a sub set of only the pages you need to provide.

How should I document my C# code? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am building the documentation for our C# API containing:
A general overview and description of the current state as a doc/pdf file.
A class library API in a .chm file using Sandcastle.
Questions:
Should I merge these two into the same .chm file? What is a good way to merge them?
I need to exclude certain classes/packages. How can I specify that in SandCastle?
It generates documentation for the VB code and the Visual C++ code. How can I change this? Or should I leave it, knowing that I am only using safe code?
Where can I find HTML Help 2.x Viewer Path on my system?
Edit:
The comments I make above methods, fields and classes are not generated in the documentation.
What should I do?
I recommend that you use Sandcastle Help File Builder from Codeplex. You can easily include and exclude namespaces, but I am unsure how to go about excluding a single class. You can set the option to only generate documentation for public/protected classes, but I do not know if that will fit your scenario.
You can also target a specific language in SHFB, as to your second question.
Additionally, you can use MAML within SHFB for conceptual documentation, such as you mention as being in the doc/pdf file. You should be able to use Doc2Maml for to migrate your existing documentation. Doc2Maml is a part of DocProject, but it appears that you might be able to run it standalone.
Edit in response to comment:
Directions are for SHFB 1.8.0.1. I do not remember the exact way to do it in 1.7, but I believe it is similar:
Under "Comments" group in the Project Properties tab, click the ellipsis to the right of "NamespaceSummaries".
In the checkbox list in the top left, uncheck any namespace you want to exclude.
This is also the screen where you put namespace summaries in.
In addition to Sand Castle as mentioned above, I would also recommend looking at FxCop and StyleCop to help make sure your code and documentation is up to CLS Compliance standards.
Sandcastle Help File Builder (SHFB) itself has a .chm file where you can find the answers to questions like "how can I exclude certain namespaces or classes from the generated doc?"
You may think I know the answer and I am being snarky by not telling you. Not true. But I was skimming the doc last night and saw an entry on this very topic.
I don't know why you wouldn't just leave in the VB and C++ stuff; there may in the future be someone who uses a language that is (shockingly) not C# with your library. The language is normally settable by the help viewer, so C# devs can ignore the VB syntax.
As for merging, SHFB has a mechanism to add in arbitrary HTML in an arbitrary hierarchy. In the GUI it is here:
http://www.freeimagehosting.net/uploads/7de19ea568.jpg
Using this, you could convert the PDF/DOC to HTML and then just embed it in the .chm.

Is there a tool for reformatting C# code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am looking for a (preferably) command-line tool that can reformat the C# source code on a directory tree. Ideally, I should be able to customize the formatting. Bonus points if the tool can be run on Mono (or Linux).
You could also try NArrange to reformat your code. The formatting options it supports are still pretty limited, but it can process an entire directory and is a command-line tool. Also, NArrange runs under Mono.
You could give Artistic Style a try. It requires Perl to be installed though.
It's got a decent list of formatting options, and supports C and Java as well.
This isn't command-line, Mono or Linux, but it's something: I've been using ReSharper (made by JetBrains) and it's rather good. It's a Visual Studio plugin, so I'm guessing it's not your cup of tea.
Take a look at Polystyle
See our SD C# Formatter. Uses a full C# parser and prettyprinter; it will not break your code.
EDIT: September, 2013: Now runs on Windows and Linux. Covers C# v5.
I use Emacs and csharp-mode. One keystroke and the module is reformatted according to my desires.
Before:
After:
For completeness, check out http://uncrustify.sourceforge.net/
Check out astyle. I am sure the KDE guys use it, but the website said that it supports C#.
Maybe you could take a look at this free Addin for Visual Studio 2010/2012 i recently wrote :)
I am going to second the ReSharper suggestion. I can't live without it.
The built-in reformatting is under ReSharper → Tools → Cleanup Code menu and is bound to Ctrl + E, Ctrl + C by default.

Categories