Index: src/Common/DelftTools.Controls.Swf/Csv/FormatPickers/DateTimeCsvFormatPickerProvider.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/DelftTools.Controls.Swf/Csv/FormatPickers/DateTimeCsvFormatPickerProvider.cs (.../DateTimeCsvFormatPickerProvider.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/DelftTools.Controls.Swf/Csv/FormatPickers/DateTimeCsvFormatPickerProvider.cs (.../DateTimeCsvFormatPickerProvider.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -13,51 +13,59 @@ public override string Label { - get { return "Date time format"; } + get + { + return "Date time format"; + } } public override Type ValueType { - get { return typeof (DateTime); } + get + { + return typeof(DateTime); + } } public override Control GetFormatPicker() { - var panel = new Panel {Height = 25, Width = 400}; - - dateTimeFormatBox = new TextBox { Left = 0, Width = 150 }; + var panel = new Panel + { + Height = 25, Width = 400 + }; + + dateTimeFormatBox = new TextBox + { + Left = 0, Width = 150 + }; dateTimeFormatBox.Leave += dateTimeFormatBox_Leave; dateTimeFormatBox.Font = new Font(dateTimeFormatBox.Font, FontStyle.Bold); - var tooltip = new ToolTip {IsBalloon = true}; + var tooltip = new ToolTip + { + IsBalloon = true + }; var caption = "y = year, M = month, d = day, h = hour (12), " + Environment.NewLine + "H = hour (24), m = minute, s = second, " + Environment.NewLine + "f = second fraction, F = second fraction (without trailing zeroes), " + Environment.NewLine + "t = PM or AM, z = time zone"; tooltip.SetToolTip(dateTimeFormatBox, caption); - var applyButton = new Button { Left = 155, Width = 45, Height = dateTimeFormatBox.Height, Text = "Apply" }; + var applyButton = new Button + { + Left = 155, Width = 45, Height = dateTimeFormatBox.Height, Text = "Apply" + }; applyButton.Click += applyButton_Click; panel.Controls.Add(dateTimeFormatBox); panel.Controls.Add(applyButton); - + return panel; } - void dateTimeFormatBox_Leave(object sender, EventArgs e) - { - FireUserSelectionChanged(); - } - - void applyButton_Click(object sender, EventArgs e) - { - //empty for reason (handled by leave event) - } - public override IFormatProvider GetFormatProvider() { - var customDTFormat = (DateTimeFormatInfo)CultureInfo.InvariantCulture.DateTimeFormat.Clone(); + var customDTFormat = (DateTimeFormatInfo) CultureInfo.InvariantCulture.DateTimeFormat.Clone(); customDTFormat.FullDateTimePattern = dateTimeFormatBox.Text; // HACK: this datetimeformatinfo object is not internally consistent, we only @@ -78,5 +86,15 @@ + " " + CultureInfo.InvariantCulture.DateTimeFormat.ShortTimePattern; } } + + private void dateTimeFormatBox_Leave(object sender, EventArgs e) + { + FireUserSelectionChanged(); + } + + private void applyButton_Click(object sender, EventArgs e) + { + //empty for reason (handled by leave event) + } } } \ No newline at end of file