private void momentaneousInfoPanel_ContextMenuSelectProperties_ItemClick(object sender, EventArgs e) { using (var form = new SelectRoutePropertyTypesForm(ApplicationSettings.MomentaneousInfoPropertyTypes)) { form.Text = Strings.SelectMomentaneousInfoProperties; if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ApplicationSettings.MomentaneousInfoPropertyTypes = form.RoutePropertyTypes; CalculateMomentaneousInfoLabelRectangles(); } } }
private void laps_ContextMenuSelectLapInfoColumns_ItemClick(object sender, EventArgs e) { // need to handle LapNumber separately as it should not be visible var routePropertyTypes = new SelectableRoutePropertyTypeCollection(); routePropertyTypes.AddRange(ApplicationSettings.LapPropertyTypes); routePropertyTypes.RemoveAt(0); using (var form = new SelectRoutePropertyTypesForm(routePropertyTypes)) { form.Text = Strings.SelectLapInfoColumns; if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK) { // need to handle LapNumber separately as it always should be included ApplicationSettings.LapPropertyTypes = new SelectableRoutePropertyTypeCollection() { new SelectableRoutePropertyType(typeof(LapNumber), true) }; ApplicationSettings.LapPropertyTypes.AddRange(form.RoutePropertyTypes); CalculateLapInfo(); } } }