protected override void Invoke(object parameter)
        {
            var e = parameter as InteractionRequestedEventArgs;

            if (e != null)
            {
                FileDialogConfirmation confirmation = e.Context as FileDialogConfirmation;

                if (confirmation != null)
                {
                    ConfigDialog(confirmation);
                }

                if (FileDialog.ShowDialog() == true)
                {
                    if (confirmation != null)
                    {
                        OnOK(confirmation);
                    }
                }

                if (e.Callback != null)
                {
                    e.Callback();
                }
            }
        }
        protected override void ConfigDialog(FileDialogConfirmation confirmation)
        {
            var c = (OpenFileDialogConfirmation)confirmation;

            if (c.Multiselect != null)
            {
                this.FileDialog.Multiselect = c.Multiselect.Value;
            }
            base.ConfigDialog(confirmation);
        }
Esempio n. 3
0
        protected override void ConfigDialog(FileDialogConfirmation confirmation)
        {
            SaveFileDialogConfirmation c = (SaveFileDialogConfirmation)confirmation;

            if (c.OverwritePrompt != null)
            {
                this.FileDialog.OverwritePrompt = c.OverwritePrompt.Value;
            }

            base.ConfigDialog(confirmation);
        }
        protected virtual void ConfigDialog(FileDialogConfirmation confirmation)
        {
            if (!string.IsNullOrEmpty(confirmation.Filter))
            {
                FileDialog.Filter = confirmation.Filter;
            }

            if (confirmation.FilterIndex >= 0)
            {
                FileDialog.FilterIndex = confirmation.FilterIndex;
            }
        }
 protected virtual void OnOK(FileDialogConfirmation confirmation)
 {
     confirmation.Confirmed = true;
     confirmation.FileName  = FileDialog.FileName;
     confirmation.FileNames = FileDialog.FileNames;
 }