internal override void SetDialogProperties(IFileDialog dialog) { base.SetDialogProperties(dialog); if (_showReadOnly) { IFileDialogCustomize customise = (IFileDialogCustomize)dialog; customise.EnableOpenDropDown(_openDropDownId); customise.AddControlItem(_openDropDownId, _openItemId, ComDlgResources.LoadString(ComDlgResourceId.OpenButton)); customise.AddControlItem(_openDropDownId, _readOnlyItemId, ComDlgResources.LoadString(ComDlgResourceId.ReadOnly)); } }
internal override void SetDialogProperties(TylorsTech.HandyClasses.WPF.Dialogs.Interop.IFileDialog dialog) { base.SetDialogProperties(dialog); if (_showReadOnly) { var customize = (TylorsTech.HandyClasses.WPF.Dialogs.Interop.IFileDialogCustomize)dialog; customize.EnableOpenDropDown(_openDropDownId); customize.AddControlItem(_openDropDownId, _openItemId, ComDlgResources.LoadString(ComDlgResources.ComDlgResourceId.OpenButton)); customize.AddControlItem(_openDropDownId, _readOnlyItemId, ComDlgResources.LoadString(ComDlgResources.ComDlgResourceId.ReadOnly)); } }
internal bool PromptUser(string text, MessageBoxButton buttons, MessageBoxImage icon, MessageBoxResult defaultResult) { string caption = string.IsNullOrEmpty(_title) ? (this is VistaOpenFileDialog ? ComDlgResources.LoadString(ComDlgResources.ComDlgResourceId.Open) : ComDlgResources.LoadString(ComDlgResources.ComDlgResourceId.ConfirmSaveAs)) : _title; MessageBoxOptions options = 0; if (System.Threading.Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft) { options |= MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading; } return(MessageBox.Show(_owner, text, caption, buttons, icon, defaultResult, options) == MessageBoxResult.Yes); }
internal bool PromptUser(string text, MessageBoxButtons buttons, MessageBoxIcon icon) { string caption = string.IsNullOrEmpty(_title) ? (this is VistaOpenFileDialog ? ComDlgResources.LoadString(ComDlgResourceId.Open) : ComDlgResources.LoadString(ComDlgResourceId.ConfirmSaveAs)) : _title; IWin32Window owner = _hwndOwner == IntPtr.Zero ? null : new WindowHandleWrapper(_hwndOwner); MessageBoxOptions options = 0; if (System.Threading.Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft) { options |= MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading; } return(MessageBox.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1, options) == DialogResult.Yes); }