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.
Related
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 ☺
This question already has answers here:
Application.ProductName equivalent in WPF?
(7 answers)
Closed 8 years ago.
Is there something similar to the following property in WPF?
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.productname(v=vs.110).aspx
Thanks.
Not that I know of. But you can easily create this method yourself.
The actual code used by WinForms has several levels of fallback: it first look for an AssemblyProductAttribute on the assembly defining the control, then at the file version and finally falls back to the first part of the namespace.
You can copy that logic (or the parts that are relevant to you) directly from .net source code: http://referencesource.microsoft.com/#System.Windows.Forms/ndp/fx/src/winforms/Managed/System/WinForms/Control.cs#f7c944851a004a6e
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.
This question already has answers here:
Find unused code [closed]
(9 answers)
Closed 9 years ago.
In a legacy ASP.NET project I have inherited, there are an abundance of methods defined which are used absolutely nowhere.
I'm familiar with the "Find usages" functionality, but would like to be able to generate a list of methods which are not called anywhere in the app. Does such functionality exist?
You can select ReSharper => Inspect => Codes Issues in solution ;
And there, you can group by "Issue Type" and you should see all issues that match with "Type or type member is never used" (unused method goes there)
(And if you click right on it, you can select : "Show only "type or type member is never used" issues" .. and there you go ;)
This question already has answers here:
How do I use the LINQPad Dump() extension method in Visual Studio? [closed]
(4 answers)
Closed 8 years ago.
Given (new [] {"a", "b"}).Dump(), LinqPad provides some very useful print results.
It seems that this extension method is a short hand for Console.WriteLine.
Question> how to implement this dump for myself?
This thread might be of use to you.
Is there a library that provides a formatted Dump( ) function like LinqPad?
With a lot of hard work.
Dump is not a shortcut for Console.WriteLine; it's an extremely complicated recursive method which turns arbitrary object graphs into HTML, with special support for collections, DataTables, Images, and a couple of other types.
It also has special output code to format collections of complex objects into tables, and to prevent recursive expansion.
You can grab the Object Dumper class that is included in the Visual C# 2008 Samples. It won't be in the pretty HTML format used by LINQPad and the other types of output it supports, but the purpose is similar.