private void Button_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; string textV = display.Content.ToString(), textVOp = opLabel.Content.ToString(); calcPresenter.Present(ref textV, ref textVOp, b.Content.ToString()); display.Content = textV; opLabel.Content = textVOp; }
private void AnyButton_TouchUpInside(object sender, EventArgs e) { UIButton btn = sender as UIButton; string textV = mainLable.Text, textVOp = signLabel.Text; calcPresenter.Present(ref textV, ref textVOp, btn.Title(UIControlState.Normal)); mainLable.Text = textV; signLabel.Text = textVOp; }
private void AnyButton_Click(object sender, EventArgs e) { Button b = sender as Button; string textV = textView.Text, textVOp = txtViewOper.Text; calcPresenter.Present(ref textV, ref textVOp, b.Text); textView.Text = textV; txtViewOper.Text = textVOp; }
public void PresentClear_Test(string buf, string disp, string oper, string sign) { FieldInfo fieldInfo = typeof(CalcPresenter) .GetField("buf", BindingFlags.NonPublic | BindingFlags.Static); fieldInfo.SetValue(_calcPresenter, buf); _calcPresenter.Present(ref disp, ref oper, sign); Assert.AreEqual("", disp); Assert.AreEqual("", fieldInfo.GetValue(_calcPresenter)); Assert.AreEqual("", oper); }