예제 #1
0
        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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #5
0
 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;
 }