是否有一个toString()生成器在Visual Studio 2010中提供? [英] Is there a ToString() generator available in Visual Studio 2010?
问题描述
有没有什么办法使用Visual Studio 2010生成一个的ToString()?
Is there any way to generate a ToString()
using Visual Studio 2010?
我真不'不想用手做这个!
I really don't want to do this by hand!
我在寻找一个简单的字符串表示我的模型。在以前的IDE *的ToString一代已在UI中使用简单的模板和字段选择启用。
I'm looking for a simple string representation of my model. In previous IDEs * ToString generation has been enabled in the UI using simple templates and field selection.
equals和hashCode目前默认实现了类似的模式提供。 。我所希望的有是的ToString类似的东西。
Currently default implementations of Equals and Hashcode are offered in a similar pattern. I'd hoped there was something similar for ToString.
这似乎不是默认 - !感谢您的答复。
It seems not by default - thanks for the responses!
(*这是我的第一个.NET项目)
(* this is my first .net project)
推荐答案
您可以创建自己的自定义代码段为每个样板代码和访问从IntelliSence结果
这是一个很好的教程 http://msdn.microsoft.com /en-us/library/ms165392.aspx
You can create your own custom snippet for every boilerplate code and access it from IntelliSence
Here is a good tutorial http://msdn.microsoft.com/en-us/library/ms165392.aspx
有如何创建与替换片段好好看看。您可以创建非常通用的结构。
Have a good look at how to create snippets with replacements. You can create quite generic structures.
这篇关于是否有一个toString()生成器在Visual Studio 2010中提供?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!