17

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
John MacIntyre
  • 12,910
  • 13
  • 67
  • 106
  • 1
    have you found an answer? – freshWoWer Aug 13 '14 at 18:32
  • 1
    @freshWoWer I haven't looked recently, but no. Last time I checked, you had no control over it at all. – John MacIntyre Aug 13 '14 at 18:42
  • 3
    I also need that. Its very annoying - for example for enums - that the order is changed. There should be an option to not order at all. I keep a smart order in my classes by default and do not need help by the IDE. :( – David Mason May 23 '21 at 09:58

1 Answers1

-1

Is this what you're looking for? http://msdn.microsoft.com/en-us/library/8tkebx17.aspx

cory-fowler
  • 4,020
  • 2
  • 18
  • 29