Inheritance: System.Windows.Forms.UserControl
Ejemplo n.º 1
0
 public void Dispose()
 {
     if (_CustomControl != null)
     {
         if (!_CustomControl.IsDisposed)
         {
             if (_CustomControl.MSDialog != null)
             {
                 _CustomControl.MSDialog.Disposed -= new EventHandler(DialogWrappper_Disposed);
                 _CustomControl.MSDialog.Dispose();
             }
             //might have been nulled by MSDialog.Dispose()
             if (_CustomControl != null)
             {
                 _CustomControl.MSDialog = null;
                 _CustomControl.Dispose();
             }
             _CustomControl = null;
         }
     }
     if (_BaseDialogNative != null)
     {
         _BaseDialogNative.Dispose();
         _BaseDialogNative = null;
     }
     if (_hDummyWnd != IntPtr.Zero)
     {
         NativeMethods.DestroyWindow(_hDummyWnd);
         DestroyHandle();
         _hDummyWnd = IntPtr.Zero;
     }
 }
Ejemplo n.º 2
0
 public MSFileDialogWrapper(FileDialogControlBase fd)
 {
     _CustomCtrl = fd;
     if (_CustomCtrl != null)
     {
         fd.MSDialog.Disposed += new EventHandler(NativeDialogWrapper_Disposed);
     }
 }
Ejemplo n.º 3
0
 public MSFileDialogWrapper(FileDialogControlBase fd)
 {
     this._CustomCtrl = fd;
     if (this._CustomCtrl != null)
     {
         fd.MSDialog.Disposed += this.NativeDialogWrapper_Disposed;
     }
 }
Ejemplo n.º 4
0
 public WholeDialogWrapper(FileDialogControlBase fileDialogEx)
 {
     //create the FileDialog &  custom control without UI yet
     _CustomControl = fileDialogEx;
     //_CustomControl.MSDialog = new FDLG();
     AssignDummyWindow();
     _WatchForActivate = true;
 }
Ejemplo n.º 5
0
 //where T : FileDialogControlBase, new()
 public static DialogResult ShowDialog(this FileDialog fdlg, FileDialogControlBase ctrl, IWin32Window owner)
 {
     ctrl.FileDlgType =(fdlg is SaveFileDialog)?FileDialogType.SaveFileDlg: FileDialogType.OpenFileDlg;
     if (ctrl.ShowDialogExt(fdlg, owner) == DialogResult.OK)
         return DialogResult.OK;
     else
         return DialogResult.Ignore;
 }
Ejemplo n.º 6
0
 public static DialogResult ShowDialog(this FileDialog fdlg, FileDialogControlBase ctrl, IWin32Window owner)
 {
     ctrl.FileDlgType = ((fdlg is SaveFileDialog) ? FileDialogType.SaveFileDlg : FileDialogType.OpenFileDlg);
     if (ctrl.ShowDialogExt(fdlg, owner) == DialogResult.OK)
     {
         return(DialogResult.OK);
     }
     return(DialogResult.Ignore);
 }
Ejemplo n.º 7
0
            public void Dispose()
            {
                //ReleaseHandle();
                if (_CustomCtrl != null && _CustomCtrl.MSDialog != null)
                {
                    _CustomCtrl.MSDialog.Disposed -= new EventHandler(NativeDialogWrapper_Disposed);
                    _CustomCtrl.MSDialog.Dispose();
                    if (_CustomCtrl != null)
                    {
                        _CustomCtrl.MSDialog = null;
                    }
                }
                if (_CustomCtrl != null)
                {
                    _CustomCtrl.Dispose();
                    _CustomCtrl = null;
                }

                DestroyHandle();
            }
Ejemplo n.º 8
0
 public void Dispose()
 {
     //ReleaseHandle();
     if (_CustomControl != null && _CustomControl.MSDialog != null)
     {
         _CustomControl.MSDialog.Disposed -= new EventHandler(DialogWrappper_Disposed);
         _CustomControl.MSDialog.Dispose();
         _CustomControl.MSDialog = null;
     }
     if (_CustomControl != null)
     {
         _CustomControl.Disposed -= new EventHandler(DialogWrappper_Disposed);
         _CustomControl.Dispose();
         _CustomControl = null;
     }
     if (_BaseDialogNative != null)
     {
         _BaseDialogNative.Dispose();
         _BaseDialogNative = null;
     }
     NativeMethods.DestroyWindow(_hDummyWnd);
     DestroyHandle();
 }
Ejemplo n.º 9
0
 public void Dispose()
 {
     if (_CustomCtrl != null)
     {
         if (_CustomCtrl.MSDialog != null)
         {
             _CustomCtrl.MSDialog.Disposed -= new EventHandler(NativeDialogWrapper_Disposed);
             _CustomCtrl.MSDialog.Dispose();
             if (_CustomCtrl != null)
                 _CustomCtrl.MSDialog = null;
         }
         if (_CustomCtrl != null)
         {
             if (!_CustomCtrl.IsDisposed)
                 _CustomCtrl.Dispose();
             _CustomCtrl = null;
         }
     }
      DestroyHandle();
 }
Ejemplo n.º 10
0
 public MSFileDialogWrapper(FileDialogControlBase fd)
 {
     _CustomCtrl = fd;
     if (_CustomCtrl != null)
         fd.MSDialog.Disposed += new EventHandler(NativeDialogWrapper_Disposed);
 }
Ejemplo n.º 11
0
            public void Dispose()
            {
                if (_CustomControl != null)
                {
                    if (!_CustomControl.IsDisposed)
                    {
                        if (_CustomControl.MSDialog != null)
                        {
                            _CustomControl.MSDialog.Disposed -= new EventHandler(DialogWrappper_Disposed);
                            _CustomControl.MSDialog.Dispose();

                        }
                        //might have been nulled by MSDialog.Dispose()
                        if (_CustomControl != null)
                        {
                            _CustomControl.MSDialog = null;
                            _CustomControl.Dispose();
                        }
                        _CustomControl = null;
                    }
                }
                if (_BaseDialogNative != null)
                {
                    _BaseDialogNative.Dispose();
                    _BaseDialogNative = null;
                }
                if (_hDummyWnd != IntPtr.Zero)
                {
                    NativeMethods.DestroyWindow(_hDummyWnd);
                    DestroyHandle();
                    _hDummyWnd = IntPtr.Zero;
                }
            }
Ejemplo n.º 12
0
 public WholeDialogWrapper(FileDialogControlBase fileDialogEx)
 {
     //create the FileDialog &  custom control without UI yet
     _CustomControl = fileDialogEx;
     //_CustomControl.MSDialog = new FDLG();
     AssignDummyWindow();
     _WatchForActivate = true;
 }
Ejemplo n.º 13
0
 public WholeDialogWrapper(FileDialogControlBase fileDialogEx)
 {
     this._CustomControl = fileDialogEx;
     this.AssignDummyWindow();
     this._WatchForActivate = true;
 }