/// <summary>
        /// Opens 'Folder Browser Dialog'
        /// </summary>
        /// <param name="defaultFolder"></param>
        /// <returns></returns>
        public static string FolderBrowser(string defaultFolder = null)
        {
            var folderBrowserDialog = new FolderBrowserDialog();

            if (defaultFolder != null)
            {
                folderBrowserDialog.SelectedPath = defaultFolder;
            }

            var result = new STAInvoker <FolderBrowserDialog, DialogResult>(folderBrowserDialog, (x) => x.ShowDialog(ForegroundWindowWrapper.GetWindow())).Invoke();

            if (result != DialogResult.OK)
            {
                throw new DialogCanceledException();
            }

            return(folderBrowserDialog.SelectedPath);
        }
        /// <summary>
        /// Opens 'Open File Dialog'
        /// </summary>
        /// <param name="filter">File filter, eg. "Text files (*.txt)|*.txt|All files (*.*)|*.*"</param>
        /// <param name="defaultFileName"></param>
        /// <returns></returns>
        public static string OpenFile(string filter = null, string defaultFileName = null)
        {
            var fileSelector = new OpenFileDialog();

            if (defaultFileName != null)
            {
                fileSelector.FileName = defaultFileName;
            }

            if (filter != null)
            {
                fileSelector.Filter = filter;
            }

            var result = new STAInvoker <OpenFileDialog, DialogResult>(fileSelector, (x) => x.ShowDialog(ForegroundWindowWrapper.GetWindow())).Invoke();

            if (result != DialogResult.OK)
            {
                throw new DialogCanceledException();
            }

            return(fileSelector.FileName);
        }