Ejemplo n.º 1
0
        public static DialogResult ShowModalDialog(Form parent, CommonDialog dialog)
        {
            parent.Enabled = false;
            DialogResult r = dialog.ShowDialog();

            parent.Enabled = true;
            dialog.Dispose();
            return(r);
        }
Ejemplo n.º 2
0
 protected void UpdateDialog()
 {
     if (_Dialog != null)
     {
         _Dialog.Dispose();
     }
     if (_Mode == BrowseMode.OpenFile)
     {
         _Dialog = new OpenFileDialog();
     }
     else if (_Mode == BrowseMode.SaveFile)
     {
         _Dialog = new SaveFileDialog();
     }
     else if (_Mode == BrowseMode.Directory)
     {
         _Dialog = new FolderBrowserDialog();
     }
 }
Ejemplo n.º 3
0
        public void Execute(SupportProcessor processor, UXData data)
        {
            if ((processor != null) && (data != null))
            {
                Processor = processor;
                Data      = data;
                Dialog    = GetDialog();
                var run = Dialog != null?Dialog.ShowDialog() == DialogResult.OK : true;

                if (run)
                {
                    Cursor.Current = Cursors.WaitCursor;
                    try
                    {
                        Process();
                    }
                    finally
                    {
                        Cursor.Current = Cursors.Default;
                        Dialog?.Dispose();
                    }
                }
            }
        }