Using default File Symbols in C# [duplicate] - c#

This question already has answers here:
Get the icon for a given extension
(4 answers)
Closed 7 years ago.
I want that a user can enter a filename and it shows him the "symbol" of the file.... like those ones:
I know that I could extract them out of their dlls and add them to my project, but I think there could be a solution which grabs them out of windows...
I would like to have a very simple implementation, because it'll be part of a school project and the examiners hate importing DLLs, it would be "unsafe", so , a function which is supported by C#'s default stuff would be very nice for me.

I found something that is much much much easier than importing DLLs or such higher things.
Icon.ExtractAssociatedIcon(filename);
it returns an icon, so you have to convert it to an Image:
(Image)new ImageConverter().ConvertFrom(Icon.ExtractAssociatedIcon(filename));
It even extracts icons of .exe 's, which is even more than I asked for.
I'm really happy that I can provide an easier answer. Thanks Stackoverflow ☺

Related

Where can all the unity intellisense functions etc. be found? [duplicate]

This question already has answers here:
Unity Scripts edited in Visual studio don't provide autocomplete
(35 answers)
Closed 4 years ago.
I've been trying to get the intellisense autocompletion to work with Unity, but after a day of trying to make it work, no solution. Using C#
I'm not asking to solutions on this problem, but to ask where the documentation is found
Solution: #John
https://docs.unity3d.com/ScriptReference/Transform.html
This has all the scripts/functions that intellisense gives you.
Check THIS. You can find everthing there. For example, if you want to implement method from MonoBehavoiur use Ctrl+Shift+M or use Ctrl + Space with all suggestions.

C# .Net4.5 API/Library method reference description inside source code [duplicate]

This question already has answers here:
Programmatically get Summary comments at runtime
(7 answers)
Closed 4 years ago.
I want to retrieve the method description inside my code. I used reflection to extract the name of the methods used in a project (used MemberInfo.GetMethod() for this). Now, I want to get the description for each of the methods extracted from the tool. Actually, I want to have the API reference descriptions made available by MSDN: https://learn.microsoft.com/en-ca/dotnet/api/?view=netframework-4.7.1.
This description comes up if we take the cursor on the method name in VS2015 IDE, but I want to get these descriptions with help of coding (Something like query with method name and have reference descriptions for that queried method). I have done this with Java and Python, but haven't found anything in C#. Please help me to figure out my problem.
I don't think that's generally possible. The description from MSDN is basically the summary and is not stored in the assembly. Also see this awnser.

Adding Tooltip for Variable in IDE [duplicate]

This question already has answers here:
How to write comments / documentation for variables / fields / lists in VS 2010?
(6 answers)
Closed 8 years ago.
Is there a syntax in Visual Studio 2008 so that, in C# development, if one of my colleagues hovers over a variable, the tooltip brings up more information, like my comments? It displays that it's a local int, and while running displays a value, but I was wondering if there was a way to make it display a personal description. Sorry for the newbie question, but all my research kept bringing up very different things than what I was looking for.
This has a duplicate question, with an answer here
As I stated earlier one should use appropriate naming, and avoid using hungarian notation.

Silverlight: Is it possible to syntax-colour XML in a textBox? [duplicate]

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

Automatic way to put all classes in separate files [duplicate]

This question already has answers here:
How can I extract all classes into separate file?
(3 answers)
Closed 9 years ago.
I've started to refactor/clean up big project. Some of files contains few small classes or few enums (yeah, it is very messy;/ ).
Is there some method or tool to automatically divide files with few enums/classes and create separate files for each of them?
As Fredrik Mörk said - Resharper is very good tool and has possibility to do what I need. But of course as almost all good tools it costs (for one it is cheap, for another not:) ).
Maybe there is some free tool for such simple refactoring? (my boss will not pay for Resharper - he told me that I need 'hammer' not a whole workshop:) )
Resharper has a refactoring that moves a type to a separate file. Might be that it can be applied on a higher level (as project); don't have it installed on this machine to verify though.
Edit: noticed in the online help that there is a refactoring called Move Types Into Matching Files that does exactly what you are asking for.
CodeRush xpress (free) also supports Moving a type into a matching file

Categories