private ShellNativeMethods.FileOpenOptions CalculateNativeDialogOptionFlags() { // We start with only a few flags set by default, // then go from there based on the current state // of the managed dialog's property values. ShellNativeMethods.FileOpenOptions flags = ShellNativeMethods.FileOpenOptions.NoTestFileCreate; // Call to derived (concrete) dialog to // set dialog-specific flags. flags = GetDerivedOptionFlags(flags); // Apply other optional flags. if (ensureFileExists) { flags |= ShellNativeMethods.FileOpenOptions.FileMustExist; } if (ensurePathExists) { flags |= ShellNativeMethods.FileOpenOptions.PathMustExist; } if (!ensureValidNames) { flags |= ShellNativeMethods.FileOpenOptions.NoValidate; } if (!EnsureReadOnly) { flags |= ShellNativeMethods.FileOpenOptions.NoReadOnlyReturn; } if (restoreDirectory) { flags |= ShellNativeMethods.FileOpenOptions.NoChangeDirectory; } if (!showPlacesList) { flags |= ShellNativeMethods.FileOpenOptions.HidePinnedPlaces; } if (!addToMruList) { flags |= ShellNativeMethods.FileOpenOptions.DontAddToRecent; } if (showHiddenItems) { flags |= ShellNativeMethods.FileOpenOptions.ForceShowHidden; } if (!navigateToShortcut) { flags |= ShellNativeMethods.FileOpenOptions.NoDereferenceLinks; } return(flags); }
internal override ShellNativeMethods.FileOpenOptions GetDerivedOptionFlags(ShellNativeMethods.FileOpenOptions flags) { if (overwritePrompt) { flags |= ShellNativeMethods.FileOpenOptions.OverwritePrompt; } if (createPrompt) { flags |= ShellNativeMethods.FileOpenOptions.CreatePrompt; } if (!isExpandedMode) { flags |= ShellNativeMethods.FileOpenOptions.DefaultNoMiniMode; } if (alwaysAppendDefaultExtension) { flags |= ShellNativeMethods.FileOpenOptions.StrictFileTypes; } return(flags); }
internal override ShellNativeMethods.FileOpenOptions GetDerivedOptionFlags(ShellNativeMethods.FileOpenOptions flags) { if (multiselect) { flags |= ShellNativeMethods.FileOpenOptions.AllowMultiSelect; } if (isFolderPicker) { flags |= ShellNativeMethods.FileOpenOptions.PickFolders; } if (!allowNonFileSystem) { flags |= ShellNativeMethods.FileOpenOptions.ForceFilesystem; } else if (allowNonFileSystem) { flags |= ShellNativeMethods.FileOpenOptions.AllNonStorageItems; } return(flags); }
internal abstract ShellNativeMethods.FileOpenOptions GetDerivedOptionFlags(ShellNativeMethods.FileOpenOptions flags);