Example #1
0
        private static OpenMultipleFilesDialog InitDialog(double?width, double?height,
                                                          string currentDirectory,
                                                          string filters, int filterIndex,
                                                          bool showHiddenFilesAndDirectories, bool showSystemFilesAndDirectories)
        {
            OpenMultipleFilesDialog dialog = new OpenMultipleFilesDialog();

            InitDialog(dialog, width, height, currentDirectory, showHiddenFilesAndDirectories, showSystemFilesAndDirectories);
            dialog.Filters     = new FileFiltersTypeConverter().ConvertFrom(null, null, filters) as IList <IFileFilter>;
            dialog.FilterIndex = filterIndex;

            return(dialog);
        }
Example #2
0
        /// <summary>
        /// Shows a new <see cref="OpenMultipleFilesDialog" />.
        /// </summary>
        /// <param name="dialogHost">The <see cref="DialogHost" /></param>
        /// <param name="args">The arguments for the dialog initialization</param>
        /// <returns></returns>
        public static async Task <OpenMultipleFilesDialogResult> ShowDialogAsync(DialogHost dialogHost, OpenMultipleFilesDialogArguments args)
        {
            OpenMultipleFilesDialog dialog = InitDialog(
                args.Width,
                args.Height,
                args.CurrentDirectory,
                args.Filters,
                args.FilterIndex,
                args.ShowHiddenFilesAndDirectories,
                args.ShowSystemFilesAndDirectories
                );

            return(await dialogHost.ShowDialog(dialog, args.OpenedHandler, args.ClosingHandler) as OpenMultipleFilesDialogResult);
        }
        /// <summary>
        /// Shows a new <see cref="OpenMultipleFilesDialog" />.
        /// </summary>
        /// <param name="dialogHostName">The name of the <see cref="DialogHost" /></param>
        /// <param name="args">The arguments for the dialog initialization</param>
        /// <returns></returns>
        public static async Task <OpenMultipleFilesDialogResult> ShowDialogAsync(string dialogHostName, OpenMultipleFilesDialogArguments args)
        {
            OpenMultipleFilesDialog dialog = InitDialog(
                args.Width,
                args.Height,
                args.CurrentDirectory,
                args.Filters,
                args.FilterIndex,
                args.ShowHiddenFilesAndDirectories,
                args.ShowSystemFilesAndDirectories,
                args.SwitchPathPartsAsButtonsEnabled,
                args.PathPartsAsButtons
                );

            return(await DialogHost.Show(dialog, dialogHostName, args.OpenedHandler, args.ClosingHandler) as OpenMultipleFilesDialogResult);
        }