Enum.GetValues question


hello expert,

i have enum below example since actually, have long list of windows message in enum:

public enum windowsmessages : int{

            ccm_first = 0x2000,
            ccm_last = (ccm_first + 0x200),
            ccm_setbkcolor = (ccm_first + 1),
            ccm_setcolorscheme = (ccm_first + 2),
            ccm_getcolorscheme = (ccm_first + 3),
            ccm_getdroptarget = (ccm_first + 4),
            ccm_setunicodeformat = (ccm_first + 5),
            ccm_getunicodeformat = (ccm_first + 6),
            ccm_setversion = (ccm_first + 0x7),
            ccm_getversion = (ccm_first + 0x8),
            ccm_setnotifywindow = (ccm_first + 0x9),
            ccm_setwindowtheme = (ccm_first + 0xb),
            ccm_dpiscale = (ccm_first + 0xc),
            hdm_getitemcount = (hdm_first + 0),
            hdm_insertitema = (hdm_first + 1)}

then use :

list<windowsmessages> thelist= enum.getvalues(typeof(windowsmessages)).cast<windowsmessages>().tolist();

however, see in thelist, there many item have same string name when use .tostring().

do make wrong?

please advise.

thanks.

or define them constants

regards,
ahmed ibrahim
sql server setup team
posting provided "as is" no warranties, , confers no rights. please remember click "mark answer" and "vote helpful" on posts you.
can beneficial other community members reading thread.



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'