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; } }
public MSFileDialogWrapper(FileDialogControlBase fd) { _CustomCtrl = fd; if (_CustomCtrl != null) fd.MSDialog.Disposed += new EventHandler(NativeDialogWrapper_Disposed); }
public static DialogResult ShowDialog(this System.Windows.Forms.FileDialog fdlg, FileDialogControlBase ctrl, IWin32Window owner) //where T : FileDialogControlBase, new() { ctrl.DialogType = (fdlg is System.Windows.Forms.SaveFileDialog) ? FileDialogType.SaveFileDlg : FileDialogType.OpenFileDlg; if (ctrl.ShowDialogExt(fdlg, owner) == DialogResult.OK) return DialogResult.OK; else return DialogResult.Ignore; }
public MSFileDialogWrapper(FileDialogControlBase fd) { _CustomCtrl = fd; if (_CustomCtrl != null) { fd.MSDialog.Disposed += new EventHandler(NativeDialogWrapper_Disposed); } }
public WholeDialogWrapper(FileDialogControlBase fileDialogEx) { //create the FileDialog & custom control without UI yet _CustomControl = fileDialogEx; //_CustomControl.MSDialog = new FDLG(); AssignDummyWindow(); _WatchForActivate = true; }
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(); }
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(); }
public static DialogResult ShowDialog(this System.Windows.Forms.FileDialog fdlg, FileDialogControlBase ctrl, IWin32Window owner) //where T : FileDialogControlBase, new() { ctrl.DialogType = (fdlg is System.Windows.Forms.SaveFileDialog) ? FileDialogType.SaveFileDlg : FileDialogType.OpenFileDlg; if (ctrl.ShowDialogExt(fdlg, owner) == DialogResult.OK) { return(DialogResult.OK); } else { return(DialogResult.Ignore); } }