Changeset 16054
- Timestamp:
- 08/06/18 17:04:41 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisImportDialog.cs
r15583 r16054 33 33 public partial class DataAnalysisImportDialog : Form { 34 34 35 private static readonly List<KeyValuePair<DateTimeFormatInfo, string>> dateTimeFormats=35 private static readonly List<KeyValuePair<DateTimeFormatInfo, string>> POSSIBLE_DATETIME_FORMATS = 36 36 new List<KeyValuePair<DateTimeFormatInfo, string>>{ 37 37 new KeyValuePair<DateTimeFormatInfo, string>(DateTimeFormatInfo.GetInstance(new CultureInfo("de-DE")), "dd/mm/yyyy hh:MM:ss" ), … … 42 42 43 43 private static readonly List<KeyValuePair<char, string>> POSSIBLE_SEPARATORS = 44 new List<KeyValuePair<char, string>>{ 44 new List<KeyValuePair<char, string>>{ 45 45 new KeyValuePair<char, string>(';', "; (Semicolon)" ), 46 new KeyValuePair<char, string>(',', ", (Comma)" ), 46 new KeyValuePair<char, string>(',', ", (Comma)" ), 47 47 new KeyValuePair<char, string>('\t', "\\t (Tab)"), 48 48 new KeyValuePair<char, string>((char)0, "all whitespaces (including tabs and spaces)") … … 52 52 new List<KeyValuePair<NumberFormatInfo, string>>{ 53 53 new KeyValuePair<NumberFormatInfo, string>(NumberFormatInfo.GetInstance(new CultureInfo("de-DE")), ", (Comma)"), 54 new KeyValuePair<NumberFormatInfo, string>(NumberFormatInfo.InvariantInfo, ". (Period)" ) 54 new KeyValuePair<NumberFormatInfo, string>(NumberFormatInfo.InvariantInfo, ". (Period)" ) 55 55 }; 56 56 … … 59 59 new KeyValuePair<Encoding, string>(Encoding.Default, "Default"), 60 60 new KeyValuePair<Encoding, string>(Encoding.ASCII, "ASCII"), 61 new KeyValuePair<Encoding, string>(Encoding.Unicode, "Unicode"), 62 new KeyValuePair<Encoding, string>(Encoding.UTF8, "UTF8") 61 new KeyValuePair<Encoding, string>(Encoding.Unicode, "Unicode"), 62 new KeyValuePair<Encoding, string>(Encoding.UTF8, "UTF8") 63 63 }; 64 64 … … 97 97 DecimalSeparatorComboBox.ValueMember = "Key"; 98 98 DecimalSeparatorComboBox.DisplayMember = "Value"; 99 DateTimeFormatComboBox.DataSource = dateTimeFormats;99 DateTimeFormatComboBox.DataSource = POSSIBLE_DATETIME_FORMATS; 100 100 DateTimeFormatComboBox.ValueMember = "Key"; 101 101 DateTimeFormatComboBox.DisplayMember = "Value"; … … 104 104 EncodingComboBox.DisplayMember = "Value"; 105 105 106 107 // set default values based on the current culture 108 var separator = POSSIBLE_SEPARATORS.Where(n => n.Value.Substring(0, 1) == CultureInfo.CurrentCulture.TextInfo.ListSeparator); 109 if (separator.Any()) 110 SeparatorComboBox.SelectedItem = separator.First(); 111 112 var decimalSeparator = POSSIBLE_DECIMAL_SEPARATORS.Where(n => n.Value.Substring(0,1) == CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator); 113 if (decimalSeparator.Any()) 114 DecimalSeparatorComboBox.SelectedItem = decimalSeparator.First(); 106 115 } 107 116 … … 158 167 OkButton.Enabled = true; 159 168 } 160 catch (Exception ex) {169 catch (Exception ex) { 161 170 if (ex is IOException || ex is InvalidOperationException || ex is ArgumentException) { 162 171 OkButton.Enabled = false;
Note: See TracChangeset
for help on using the changeset viewer.