Blacker.MangaScraper.Services.InteractionService.ShowFolderBrowserDialog C# (CSharp) Метод

ShowFolderBrowserDialog() публичный Метод

public ShowFolderBrowserDialog ( string defaultPath, string description, bool showNewFolderButton, string>.Action callback ) : void
defaultPath string
description string
showNewFolderButton bool
callback string>.Action
Результат void
        public void ShowFolderBrowserDialog(string defaultPath, string description, bool showNewFolderButton, Action<DialogResult, string> callback)
        {
            if (callback == null)
                throw new ArgumentNullException("callback");

            using (var dlg = new FolderBrowserDialog())
            {
                dlg.SelectedPath = defaultPath;
                dlg.Description = description;
                dlg.ShowNewFolderButton = showNewFolderButton;

                var result = dlg.ShowDialog();

                try
                {
                    callback(result, dlg.SelectedPath);
                }
                catch (Exception ex)
                {
                    _log.Error("Error invoking callback.", ex);
                }
            }
        }