public void PubDiv(Calculation calc, String operation) { calc.SetOperation(operation); CalculationArgs calcArgs = new CalculationArgs(calc, operation); OnSubtraction(calcArgs); }
public void PubPow(Calculation calc, String operation) { calc.SetOperation(operation); CalculationArgs calcArgs = new CalculationArgs(calc, operation); OnPower(calcArgs); }
public void PubSqrt(Calculation calc, String operation) { calc.SetOperation(operation); CalculationArgs calcArgs = new CalculationArgs(calc, operation); OnSqrt(calcArgs); }
public void PubMult(Calculation calc, String operation) { calc.SetOperation(operation); CalculationArgs calcArgs = new CalculationArgs(calc, operation); OnMultiplication(calcArgs); }
public void PubAdd(Calculation calc, String operation) { calc.SetOperation(operation); CalculationArgs calcArgs = new CalculationArgs(calc, operation); OnAddition(calcArgs); }
public void PubOp(Calculation calc) { string userInput = Console.ReadLine(); calc.SetOperation(userInput); Console.WriteLine("Operation Received"); Console.WriteLine(userInput); CalculationArgs calcArgs = new CalculationArgs(calc, userInput); OnOperation(calcArgs); }
public void PubInput2(Calculation calc) { double Input2 = Double.Parse(Console.ReadLine()); calc.SetInputB(Input2); Console.WriteLine("Input Received"); Console.WriteLine(Input2); String s = ""; CalculationArgs calcArgs = new CalculationArgs(calc, s); OnOperation(calcArgs); }
void HandleSqrt(object sender, CalculationArgs e) { Calculator.GetResult(e.GetCalculation); InputHistory.GetInstance().AddHistory(e.GetCalculation); }
void HandleError(object sender, CalculationArgs e) { Console.WriteLine(e.GetException); }
void HandleUnassigned(object sender, CalculationArgs e) { InputProcessor _proc = new InputProcessor(); _proc.Calculate(e.GetCalculation); }
public void PubHist(Calculation calc, String operation) { CalculationArgs calcArgs = new CalculationArgs(calc, operation); OnHist(calcArgs); }
protected virtual void OnSubtraction(CalculationArgs c) { EventHandler <CalculationArgs> calcEvent = RaiseSubtraction; calcEvent(this, c); }
void HandleHistory(object sender, CalculationArgs e) { InputHistory.GetInstance().ViewHistory(); }
protected virtual void OnMultiplication(CalculationArgs c) { EventHandler <CalculationArgs> calcEvent = RaiseMultiplication; calcEvent(this, c); }
protected virtual void OnHist(CalculationArgs c) { EventHandler <CalculationArgs> calcEvent = RaiseCalcEvent; calcEvent(this, c); }
/* void HandleOperation(object sender, CalculationArgs e) * { * Console.WriteLine("Operation Handled."); * } * void HandleInput1(object sender, CalculationArgs e) * { * InputProcessor _proc = new InputProcessor(); * _proc.Calculate(e.GetCalculation); * * } * void HandleInput2(object sender, CalculationArgs e) * { * InputProcessor _proc = new InputProcessor(); * _proc.Calculate(e.GetCalculation); * * }*/ void HandleException(object sender, CalculationArgs e) { Console.WriteLine("Calculation failed. Error thrown."); }
protected virtual void OnPower(CalculationArgs c) { EventHandler <CalculationArgs> calcEvent = RaiseSquare; calcEvent(this, c); }
protected virtual void OnDivision(CalculationArgs c) { EventHandler <CalculationArgs> calcEvent = RaiseDivision; calcEvent(this, c); }