private void Button_Number_Edit(object sender, EventArgs e) { TAEditor.Command parsed_command; Button button = (Button)sender; string tag = button.Tag.ToString(); string part_tag = tag.Substring(0, tag.IndexOf('_')) + "_"; switch (part_tag) { case TAG_PNUMBER: pNumber_ctrl.Edit.Notation = new TNumber(trackBar_PNumber.Value); Enum.TryParse(tag.Replace(TAG_PNUMBER, string.Empty), out parsed_command); tB_PNumber.Text = pNumber_ctrl.ExecCommandEditor(parsed_command); break; case TAG_FRAC: Enum.TryParse(tag.Replace(TAG_FRAC, string.Empty), out parsed_command); tB_Frac.Text = frac_ctrl.ExecCommandEditor(parsed_command); break; case TAG_COMPLEX: Enum.TryParse(tag.Replace(TAG_COMPLEX, string.Empty), out parsed_command); tB_Complex.Text = complex_ctrl.ExecCommandEditor(parsed_command); break; } }
private void Button_Number_Edit(object sender, EventArgs e) { Button button = (Button)sender; string FullTag = button.Tag.ToString(); if (FullTag.StartsWith(TAG_FRAC)) { Enum.TryParse(FullTag.Replace(TAG_FRAC, string.Empty), out AEditor.Command ParsedEnum); tB_Frac.Text = fracController.ExecCommandEditor(ParsedEnum); } else if (FullTag.StartsWith(TAG_COMPLEX)) { Enum.TryParse(FullTag.Replace(TAG_COMPLEX, string.Empty), out AEditor.Command ParsedEnum); tB_Complex.Text = complexController.ExecCommandEditor(ParsedEnum); } else if (FullTag.StartsWith(TAG_PNUMBER)) { pNumberController.Edit.Notation = new TNumber(trackBar_PNumber.Value); Enum.TryParse(FullTag.Replace(TAG_PNUMBER, string.Empty), out AEditor.Command ParsedEnum); tB_PNumber.Text = pNumberController.ExecCommandEditor(ParsedEnum); } }