With extension I meant a Visual Studio Extension.
I want to know if there's a way to autogenerate a ToString method with an already created extension.
I want to have a class with some properties and use a tool to generate the ToString method using its properties.
class A {
String propA { get; set; }
String propB { get; set; }
// Autogenerated
override ToString()
{
return "propA = " + propA + ", propB" + propB;
}
}
If not, I want to know how can I make one. I searched the web but I can't find the correct way to add custom code to a already created class with a extension. Especially the project type I need to create.
Edit: This question Is there a ToString() generator available in Visual Studio 2010? didn't answer what I want; you can't use a snippet to generate code from the properties of the class. You can only add code or replace some created code.
ToString
method in your class. – Oryx