@@ -12,7 +12,6 @@ namespace Uno.Extensions.Storage.Pickers
12
12
internal class FolderPickerExtension : IFolderPickerExtension
13
13
{
14
14
private readonly FolderPicker _picker ;
15
- private WndProc _callback ;
16
15
17
16
public Guid ? SuggestedStartLocation { get ; private set ; }
18
17
@@ -40,9 +39,9 @@ public FolderPickerExtension(FolderPicker owner)
40
39
NativeMethods . BROWSEINFO pbi = new NativeMethods . BROWSEINFO ( ) ;
41
40
pbi . ulFlags = 0x41 ; //BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE
42
41
pbi . pszDisplayName = new string ( '\0 ' , NativeMethods . MAX_PATH ) ;
43
- _callback = new WndProc ( FolderBrowserDialog_BrowseCallbackProc ) ;
44
- var cp = Marshal . GetFunctionPointerForDelegate ( _callback ) ;
45
- GC . KeepAlive ( _callback ) ;
42
+ var callback = new WndProc ( FolderBrowserDialog_BrowseCallbackProc ) ;
43
+ var cp = Marshal . GetFunctionPointerForDelegate ( callback ) ;
44
+ GC . KeepAlive ( callback ) ;
46
45
pbi . lpfn = cp ;
47
46
IntPtr pidl = NativeMethods . SHBrowseForFolder ( ref pbi ) ;
48
47
if ( pidl != IntPtr . Zero )
@@ -116,7 +115,7 @@ private static class NativeMethods
116
115
private const uint BFFM_SETSELECTIONW = ( WM_USER + 103 ) ;
117
116
internal const uint BFFM_ENABLEOK = ( WM_USER + 101 ) ;
118
117
internal const uint BFFM_SETOKTEXT = ( WM_USER + 105 ) ;
119
- internal static uint BFFM_SETSELECTION = Marshal . SystemDefaultCharSize == 1
118
+ internal readonly static uint BFFM_SETSELECTION = Marshal . SystemDefaultCharSize == 1
120
119
? BFFM_SETSELECTIONA
121
120
: BFFM_SETSELECTIONW ;
122
121
internal const int MAX_PATH = 260 ;
0 commit comments