Open roman-khazanskii opened 2 years ago
No technical reason... The code was written many years ago so I'd guess that the intent of the original author was to return null
in case the VistaFolderBrowserDialog
was not supported by the operating system where the app is running, but the code doesn't have that behavior implemented and couldn't return null
, so we could change it to a regular bool
in a future release
Okay, this is not a real issue, I was just wondering if I should handle null case. Thanks!
I randomly found this issue, and since I'm the original author, I can answer this (if royally late). The various common file dialog classes were designed to have the exact same API as the original WPF OpenFileDialog
and SaveFileDialog
classes, so they could serve as a drop-in replacement. Although WPF doesn't have a native FolderBrowserDialog
, I still wanted to use the same API.
So as you might have guessed, the ShowDialog
method of those native classes returns bool?
, and therefore so do the Ookii.Dialogs classes, even though they never return null.
Comment states:
Is it even possible to have a null returned from there?