.net - Why does Visual Studio only expose part of the Environent.SpecialFolder enumeration? -
the .net documentation shows environment.specialfolder enumeration extensive, , apply versions of framework , including 4.0. when attempted use in visual studio 2010 professional, found intellisense did not recognise commondocuments member. used context menu "go definition", whereupon opened new tab called "environment [from metadata]" showed specialfolder enumeration follows:
// summary: // specifies enumerated constants used retrieve directory paths system // special folders. [comvisible(true)] public enum specialfolder { // summary: // logical desktop rather physical file system location. desktop = 0, // // summary: // directory contains user's program groups. programs = 2, // // summary: // directory serves common repository documents. personal = 5, // // summary: // "my documents" folder. mydocuments = 5, // // summary: // directory serves common repository user's favorite // items. favorites = 6, // // summary: // directory corresponds user's startup program group. startup = 7, // // summary: // directory contains user's used documents. recent = 8, // // summary: // directory contains send menu items. sendto = 9, // // summary: // directory contains start menu items. startmenu = 11, // // summary: // "my music" folder. mymusic = 13, // // summary: // directory used physically store file objects on desktop. desktopdirectory = 16, // // summary: // "my computer" folder. mycomputer = 17, // // summary: // directory serves common repository document templates. templates = 21, // // summary: // directory serves common repository application-specific // data current roaming user. applicationdata = 26, // // summary: // directory serves common repository application-specific // data used current, non-roaming user. localapplicationdata = 28, // // summary: // directory serves common repository temporary internet files. internetcache = 32, // // summary: // directory serves common repository internet cookies. cookies = 33, // // summary: // directory serves common repository internet history items. history = 34, // // summary: // directory serves common repository application-specific // data used users. commonapplicationdata = 35, // // summary: // system directory. system = 37, // // summary: // program files directory. programfiles = 38, // // summary: // "my pictures" folder. mypictures = 39, // // summary: // directory components shared across applications. commonprogramfiles = 43, }
as can see, both skips values works through list of members , stops @ commonprogramfiles. documentation shows 47 members of enumeration, whereas visual studio shows contain 23 members.
can explain discrepancy , need correct please?
michael
it's 2.0
that's version of .net still supports windows 98 , 2000. ancient operating systems didn't have many common folders. in general problem in .net, tries agnostic of operating system versions make hard take advantage of newer os features.
the enum extended in .net 4.0, possible because dropped support windows 2000.
do take unsubtle hint targeting .net 2.0 no longer makes sense. odds you'll find customer requires miniscule. , highly doubtful you'll want support him when he's got windows 98 or 2000 specific problem.
Comments
Post a Comment