public bool OpenFolderPanel(out string resultPath)
    {
        var fd       = new VistaFolderBrowserDialog();
        var res      = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
        var filename = res == DialogResult.OK ? fd.SelectedPath : string.Empty;

        fd.Dispose();
        resultPath = filename;

        return(!string.IsNullOrEmpty(resultPath));
    }
Example #2
0
        public string[] OpenFolderPanel(string title, string directory, bool multiselect)
        {
            var fd = new VistaFolderBrowserDialog();

            fd.Description  = title;
            fd.SelectedPath = string.IsNullOrEmpty(directory) ? "" : Path.GetFullPath(directory);
            var res       = fd.ShowDialog();
            var filenames = res == DialogResult.OK ? new [] { fd.SelectedPath } : new string[0];

            fd.Dispose();
            return(filenames);
        }
Example #3
0
        public string[] OpenFolderPanel(string title, string directory, bool multiselect)
        {
            var fd = new VistaFolderBrowserDialog();

            fd.Description  = title;
            fd.RootFolder   = Environment.SpecialFolder.MyComputer;
            fd.SelectedPath = directory;
            var res       = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
            var filenames = res == DialogResult.OK ? new[] { fd.SelectedPath } : new string[0];

            fd.Dispose();
            return(filenames);
        }
Example #4
0
        public string[] OpenFolderPanel(string title, string directory, bool multiselect)
        {
            var fd = new VistaFolderBrowserDialog();

            fd.Description = title;
            if (!string.IsNullOrEmpty(directory))
            {
                fd.SelectedPath = GetDirectoryPath(directory);
            }
            var res       = fd.ShowDialog(new WindowWrapper(GetActiveWindow()));
            var filenames = res == DialogResult.OK ? new[] { fd.SelectedPath } : new string[0];

            fd.Dispose();
            return(filenames);
        }