Esempio n. 1
0
        private void Button_Number_Function(object sender, EventArgs e)
        {
            TProc <TFrac> .Func    parsed_frac_func;
            TProc <TPNumber> .Func parsed_pNumber_func;
            TProc <TComplex> .Func parsed_complex_func;
            Button button   = (Button)sender;
            string tag      = button.Tag.ToString();
            string part_tag = tag.Substring(0, tag.IndexOf('_')) + "_";

            switch (part_tag)
            {
            case TAG_PNUMBER:
                Enum.TryParse(tag.Replace(TAG_PNUMBER, string.Empty), out parsed_pNumber_func);
                tB_PNumber.Text = pNumber_ctrl.ExecFunction(parsed_pNumber_func);
                break;

            case TAG_FRAC:
                Enum.TryParse(tag.Replace(TAG_FRAC, string.Empty), out parsed_frac_func);
                tB_Frac.Text = Number_to_state(TAG_FRAC, frac_ctrl.ExecFunction(parsed_frac_func));
                break;

            case TAG_COMPLEX:
                Enum.TryParse(tag.Replace(TAG_COMPLEX, string.Empty), out parsed_complex_func);
                tB_Complex.Text = Number_to_state(TAG_COMPLEX, complex_ctrl.ExecFunction(parsed_complex_func));
                break;
            }
        }
Esempio n. 2
0
        private void Button_Number_Function(object sender, EventArgs e)
        {
            Button button  = (Button)sender;
            string FullTag = button.Tag.ToString();

            if (FullTag.StartsWith(TAG_FRAC))
            {
                string Command = FullTag.Replace(TAG_FRAC, string.Empty);
                Enum.TryParse(Command, out TProc <TFrac> .Func ParsedEnum);
                tB_Frac.Text = NumberBeatifier(TAG_FRAC, fracController.ExecFunction(ParsedEnum));
            }
            else if (FullTag.StartsWith(TAG_COMPLEX))
            {
                string Command = FullTag.Replace(TAG_COMPLEX, string.Empty);
                Enum.TryParse(Command, out TProc <TComplex> .Func ParsedEnum);
                tB_Complex.Text = NumberBeatifier(TAG_COMPLEX, complexController.ExecFunction(ParsedEnum));
            }
            else if (FullTag.StartsWith(TAG_PNUMBER))
            {
                string Command = FullTag.Replace(TAG_PNUMBER, string.Empty);
                Enum.TryParse(Command, out TProc <TPNumber> .Func ParsedEnum);
                tB_PNumber.Text = pNumberController.ExecFunction(ParsedEnum);
            }
        }