Esempio n. 1
0
        private void TextBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            System.Windows.Interop.HwndSource source = PresentationSource.FromVisual(this) as System.Windows.Interop.HwndSource;
            System.Windows.Forms.IWin32Window win    = new OldWindow(source.Handle);
            FolderSelector fs = new FolderSelector()
            {
                DirectoryPath = string.IsNullOrEmpty(GlobalData.VM_MA.SavePath) ? Environment.CurrentDirectory : GlobalData.VM_MA.SavePath
            };

            if (fs.ShowDialog(win) == System.Windows.Forms.DialogResult.OK)
            {
                GlobalData.VM_MA.SavePath = fs.DirectoryPath;
            }
        }
Esempio n. 2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            FolderSelector browser = new FolderSelector();

            if (value != null)
            {
                browser.DirectoryPath = string.Format("{0}", value);
            }
            if (browser.ShowDialog(null) == DialogResult.OK)
            {
                return(browser.DirectoryPath);
            }
            return(value);
        }