如何防止类图中的属性名称被排序?
我倾向于设计我的类,其中的属性按对我有意义的顺序排序。例如;我总是在开头附近添加诸如“id”之类的关键信息,然后是 less 和 less 。不太重要的数据,最后在接近尾声时记录“创建日期”等元数据。
但是,当我将类添加到 Visual Studio (2010) 类图中时,它会按字母顺序对属性进行排序。有什么办法可以关闭这个功能吗?
编辑(11/05/11):
例如,我有以下类
public class Email
{
public Int64 Id { get; set; }
public Int64 UserId { get; set; }
public string Name { get; set; }
public string EmailAddress { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
}
但是当我将其添加到我的图表中时,它按以下顺序显示属性:
CreateDate
EmailAddress
Id
Name
UpdateDate
UserId
而不是我期望的顺序
Id
UserId
Name
EmailAddress
CreateDate
UpdateDate
I tend to design my classes with properties sorted in an order that makes sense to me. For example; I always make critical info like 'id' near the beginning, followed by less & less important data, and finally record meta data like 'create date' near the end.
But when I add the class to Visual Studio's (2010) class diagram, it sorts the properties alphabetically. Is there anyway to turn this functionality off?
Edit (11/05/11):
For example, I have the following class
public class Email
{
public Int64 Id { get; set; }
public Int64 UserId { get; set; }
public string Name { get; set; }
public string EmailAddress { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
}
But when I add it to my diagram, it displays properties in the following order:
CreateDate
EmailAddress
Id
Name
UpdateDate
UserId
Instead of the order I expect
Id
UserId
Name
EmailAddress
CreateDate
UpdateDate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是您要找的吗? http://msdn.microsoft.com/en-us/library/8tkebx17.aspx
Is this what you're looking for? http://msdn.microsoft.com/en-us/library/8tkebx17.aspx