public bool Update(ProfileData profile, double xclear, LatheMode xmode) { WizardConfig.xmode = xmode; if (profile != null) { ActiveProfile.Profile = profile; ActiveProfile.Profile.XClearance = xclear; } this.profile.Save(); return(true); }
void btnOk_Click(object sender, EventArgs e) { LatheMode xmode = btnRadius.Checked ? LatheMode.Radius : LatheMode.Diameter; ProfileData profile = null; if (cbxProfile.SelectedValue != null) { profile = options.Profiles[(int)cbxProfile.SelectedValue]; assignValues(options.Profiles[(int)cbxProfile.SelectedValue]); } options.Update(profile, cvXClearance.Value, xmode); this.Close(); }
public static double ConvertX(LatheMode source, LatheMode target, double value) { if (source != target) { switch (target) { case LatheMode.Radius: value /= 2.0d; break; case LatheMode.Diameter: value *= 2.0d; break; } } return(value); }
public bool Update(ProfileData profile, double xclear, LatheMode xmode) { this.xmode = xmode; if (profile != null) { Current = profile; Current.XClearance = xclear; } this.profile.Save(); if (dialog != null) { dialog.InitUI(); // use event instead? } return(true); }
public void setXMode(LatheMode xmode) { this.lblXMode.Visible = true; this.lblXMode.Text = xmode == LatheMode.Radius ? "Radius" : "Diameter"; }