private void SetDialogProperties(Ookii.Dialogs.Wpf.Interop.IFileDialog dialog) { // Description if (!string.IsNullOrEmpty(_description)) { if (UseDescriptionForTitle) { dialog.SetTitle(_description); } else { Ookii.Dialogs.Wpf.Interop.IFileDialogCustomize customize = (Ookii.Dialogs.Wpf.Interop.IFileDialogCustomize)dialog; customize.AddText(0, _description); } } dialog.SetOptions(NativeMethods.FOS.FOS_PICKFOLDERS | NativeMethods.FOS.FOS_FORCEFILESYSTEM | NativeMethods.FOS.FOS_FILEMUSTEXIST); if (!string.IsNullOrEmpty(_selectedPath)) { string parent = Path.GetDirectoryName(_selectedPath); if (parent == null || !Directory.Exists(parent)) { dialog.SetFileName(_selectedPath); } else { string folder = Path.GetFileName(_selectedPath); dialog.SetFolder(NativeMethods.CreateItemFromParsingName(parent)); dialog.SetFileName(folder); } } }
internal override void SetDialogProperties(IFileDialog dialog) { base.SetDialogProperties(dialog); uint cookie; var events = new TraceLabSaveAsDialogEvents(this); dialog.Advise(events, out cookie); Ookii.Dialogs.Wpf.Interop.IFileDialogCustomize customize = (Ookii.Dialogs.Wpf.Interop.IFileDialogCustomize)dialog; customize.StartVisualGroup(_configVisualGroupId, "Referenced files:"); customize.AddComboBox(_comboBoxId); customize.AddControlItem(_comboBoxId, _ignoreId, ignoreLabel); customize.AddControlItem(_comboBoxId, _copyId, copyLabel); customize.AddControlItem(_comboBoxId, _copyOverwriteId, copyOverwriteLabel); customize.AddControlItem(_comboBoxId, _keepReferenceId, determinePathsLabel); customize.SetSelectedControlItem(_comboBoxId, _ignoreId); //select default customize.EndVisualGroup(); customize.AddText(_helpTextId, ignoreDescription); }