- interopmadesimple.zip
- SimpleCalc
- SimpleCalcClient
- SimpleCalcInterop
- SimpleCalcInterop
- SimpleCalcInteropLateBinding
- SimpleCalcTesterNET
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SimpleCalcTesterNET
{
public partial class SimpleCalcTesterForm : Form
{
public SimpleCalcTesterForm()
{
InitializeComponent();
}
private void btAddEB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInterop.ISimpleCalc calculator = new SimpleCalcInterop.SimpleCalc();
txResult.Text = calculator.Add(oper1, oper2).ToString();
}
private void btSubtractEB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInterop.ISimpleCalc calculator = new SimpleCalcInterop.SimpleCalc();
txResult.Text = calculator.Subtract(oper1, oper2).ToString();
}
private void btMultiplyEB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInterop.ISimpleCalc calculator = new SimpleCalcInterop.SimpleCalc();
txResult.Text = calculator.Multiply(oper1, oper2).ToString();
}
private void btDivideEB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInterop.ISimpleCalc calculator = new SimpleCalcInterop.SimpleCalc();
txResult.Text = calculator.Divide(oper1, oper2).ToString();
}
private void btAddLB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInteropLateBinding.ISimpleCalc calculator = new SimpleCalcInteropLateBinding.SimpleCalc();
txResult.Text = calculator.Add(oper1, oper2).ToString();
}
private void btSubtractLB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInteropLateBinding.ISimpleCalc calculator = new SimpleCalcInteropLateBinding.SimpleCalc();
txResult.Text = calculator.Subtract(oper1, oper2).ToString();
}
private void btMultiplyLB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInteropLateBinding.ISimpleCalc calculator = new SimpleCalcInteropLateBinding.SimpleCalc();
txResult.Text = calculator.Multiply(oper1, oper2).ToString();
}
private void btDivideLB_Click(object sender, EventArgs e)
{
double oper1 = double.Parse(txOper1.Text);
double oper2 = double.Parse(txOper2.Text);
SimpleCalcInteropLateBinding.ISimpleCalc calculator = new SimpleCalcInteropLateBinding.SimpleCalc();
txResult.Text = calculator.Divide(oper1, oper2).ToString();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.