private static string PromptForFileName(string folder, string defaultExt)
        {
            DirectoryInfo  dir    = new DirectoryInfo(folder);
            FileNameDialog dialog = new FileNameDialog(dir.Name, defaultExt);
            var            result = dialog.ShowDialog();

            return((result.HasValue && result.Value) ? dialog.Input : string.Empty);
        }
Example #2
0
		private string PromptForFileName(string folder)
		{
			DirectoryInfo dir = new DirectoryInfo(folder);
			FileNameDialog dialog = new FileNameDialog(dir.Name);

			IntPtr hwnd = new IntPtr(_dte.MainWindow.HWnd);
			System.Windows.Window window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual;
			dialog.Owner = window;

			bool? result = dialog.ShowDialog();
			return (result.HasValue && result.Value) ? dialog.Input : string.Empty;
		}
        private string PromptForFileName(string folder, AppServiceDialogViewModel viewmodel)
        {
            var dialog = new FileNameDialog(viewmodel);

            var hwnd   = new IntPtr(_dte.MainWindow.HWnd);
            var window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual;

            dialog.Owner = window;

            bool?result = dialog.ShowDialog();

            return((result.HasValue && result.Value) ? dialog.Input : string.Empty);
        }
Example #4
0
        private FileNameDialogResult PromptForFileName(string folder, string projectName)
        {
            var dir    = new DirectoryInfo(folder);
            var dialog = new FileNameDialog(dir.Name, projectName);

            var hwnd   = new IntPtr(_dte.MainWindow.HWnd);
            var window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual;

            dialog.Owner = window;

            var result = dialog.ShowDialog();

            return((result.HasValue && result.Value) ? dialog.Input : null);
        }
 private static string PromptForFileName(string folder, string defaultExt)
 {
     DirectoryInfo dir = new DirectoryInfo(folder);
     FileNameDialog dialog = new FileNameDialog(dir.Name, defaultExt);
     var result = dialog.ShowDialog();
     return (result.HasValue && result.Value) ? dialog.Input : string.Empty;
 }