/// <summary> /// Simple static Show method for easy use /// </summary> /// <param name="parent">parent window</param> /// <param name="fileFilter">file filter (for example "All(*.*)|*.*")</param> /// <param name="language">additional language setting</param> /// <returns>Dialog result Ok Or Cancel with selected file</returns> public static StaticOpenFilePanelDialogResult Show(IWin32Window parent, string fileFilter, OpenFilePanelDialogLanguage language = OpenFilePanelDialogLanguage.English) { if (null == parent) { throw new ArgumentNullException(); } OpenFilePanelDialog dialog = new OpenFilePanelDialog(language); dialog.InnerOpenFilePanel.Misc.FileFilter = fileFilter; DialogResult dr = dialog.ShowDialog(parent); return(new StaticOpenFilePanelDialogResult(dr, dialog.InnerOpenFilePanel.SelectedFiles)); }
/// <summary> /// Simple static Show method for easy use /// </summary> /// <param name="parent">parent window</param> /// <param name="fileFilter">file filter (for example "All(*.*)|*.*")</param> /// <param name="language">additional language setting</param> /// <returns>Dialog result Ok Or Cancel with selected file</returns> public static StaticOpenFilePanelDialogResult Show(IWin32Window parent, string fileFilter,OpenFilePanelDialogLanguage language = OpenFilePanelDialogLanguage.English) { if (null == parent) throw new ArgumentNullException(); OpenFilePanelDialog dialog = new OpenFilePanelDialog(language); dialog.InnerOpenFilePanel.Misc.FileFilter = fileFilter; DialogResult dr = dialog.ShowDialog(parent); return new StaticOpenFilePanelDialogResult(dr, dialog.InnerOpenFilePanel.SelectedFiles); }