@@ -71,61 +71,48 @@ public static string GetExecutablePathNative()
7171 }
7272 }
7373
74- public static string GetKnownFolderPath ( PickerLocationId pickerLocationId )
74+ public static string GetKnownFolderPath ( Windows . Storage . Pickers . PickerLocationId pickerLocationId )
7575 {
7676 Guid folderId ;
7777
7878 switch ( pickerLocationId )
7979 {
80- case PickerLocationId . DocumentsLibrary :
80+ case Windows . Storage . Pickers . PickerLocationId . DocumentsLibrary :
8181 folderId = new Guid ( "FDD39AD0-238F-46AF-ADB4-6C85480369C7" ) ; // FOLDERID_Documents
8282 break ;
83- case PickerLocationId . ComputerFolder :
83+ case Windows . Storage . Pickers . PickerLocationId . ComputerFolder :
8484 folderId = new Guid ( "0AC0837C-BBF8-452A-850D-79D08E667CA7" ) ; // FOLDERID_ComputerFolder
8585 break ;
86- case PickerLocationId . Desktop :
86+ case Windows . Storage . Pickers . PickerLocationId . Desktop :
8787 folderId = new Guid ( "B4BFCC3A-DB2C-424C-B029-7FE99A87C641" ) ; // FOLDERID_Desktop
8888 break ;
89- case PickerLocationId . Downloads :
89+ case Windows . Storage . Pickers . PickerLocationId . Downloads :
9090 folderId = new Guid ( "374DE290-123F-4565-9164-39C4925E467B" ) ; // FOLDERID_Downloads
9191 break ;
92- case PickerLocationId . HomeGroup :
92+ case Windows . Storage . Pickers . PickerLocationId . HomeGroup :
9393 folderId = new Guid ( "52528A6B-B9E3-4ADD-B60D-588C2DBA842D" ) ; // FOLDERID_HomeGroup
9494 break ;
95- case PickerLocationId . MusicLibrary :
95+ case Windows . Storage . Pickers . PickerLocationId . MusicLibrary :
9696 folderId = new Guid ( "4BD8D571-6D19-48D3-BE97-422220080E43" ) ; // FOLDERID_MusicLibrary
9797 break ;
98- case PickerLocationId . PicturesLibrary :
98+ case Windows . Storage . Pickers . PickerLocationId . PicturesLibrary :
9999 folderId = new Guid ( "33E28130-4E1E-4676-835A-98395C3BC3BB" ) ; // FOLDERID_PicturesLibrary
100100 break ;
101- case PickerLocationId . VideosLibrary :
101+ case Windows . Storage . Pickers . PickerLocationId . VideosLibrary :
102102 folderId = new Guid ( "18989B1D-99B5-455B-841C-AB7C74E4DDFC" ) ; // FOLDERID_VideosLibrary
103103 break ;
104- case PickerLocationId . Objects3D :
104+ case Windows . Storage . Pickers . PickerLocationId . Objects3D :
105105 folderId = new Guid ( "31C0DD25-9439-4F12-BF41-7FF4EDA38722" ) ; // FOLDERID_Objects3D
106106 break ;
107- case PickerLocationId . Unspecified :
107+ case Windows . Storage . Pickers . PickerLocationId . Unspecified :
108108 default :
109109 return string . Empty ;
110110 }
111111
112112 PWSTR pszPath ;
113- int hr = PInvoke . SHGetKnownFolderPath ( ref folderId , 0 , null , out pszPath ) ;
113+ int hr = PInvoke . SHGetKnownFolderPath ( in folderId , 0 , null , out pszPath ) ;
114114 if ( hr != 0 ) return string . Empty ;
115115
116116 return pszPath . ToString ( ) ;
117117 }
118118}
119- public enum PickerLocationId
120- {
121- DocumentsLibrary ,
122- ComputerFolder ,
123- Desktop ,
124- Downloads ,
125- HomeGroup ,
126- MusicLibrary ,
127- PicturesLibrary ,
128- VideosLibrary ,
129- Objects3D ,
130- Unspecified
131- }
0 commit comments