Esempio n. 1
0
        public void PubDiv(Calculation calc, String operation)
        {
            calc.SetOperation(operation);
            CalculationArgs calcArgs = new CalculationArgs(calc, operation);

            OnSubtraction(calcArgs);
        }
Esempio n. 2
0
        public void PubPow(Calculation calc, String operation)
        {
            calc.SetOperation(operation);
            CalculationArgs calcArgs = new CalculationArgs(calc, operation);

            OnPower(calcArgs);
        }
Esempio n. 3
0
        public void PubSqrt(Calculation calc, String operation)
        {
            calc.SetOperation(operation);
            CalculationArgs calcArgs = new CalculationArgs(calc, operation);

            OnSqrt(calcArgs);
        }
Esempio n. 4
0
        public void PubMult(Calculation calc, String operation)
        {
            calc.SetOperation(operation);
            CalculationArgs calcArgs = new CalculationArgs(calc, operation);

            OnMultiplication(calcArgs);
        }
Esempio n. 5
0
        public void PubAdd(Calculation calc, String operation)
        {
            calc.SetOperation(operation);
            CalculationArgs calcArgs = new CalculationArgs(calc, operation);

            OnAddition(calcArgs);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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);
        }
Esempio n. 11
0
        public void PubHist(Calculation calc, String operation)
        {
            CalculationArgs calcArgs = new CalculationArgs(calc, operation);

            OnHist(calcArgs);
        }
Esempio n. 12
0
        protected virtual void OnSubtraction(CalculationArgs c)
        {
            EventHandler <CalculationArgs> calcEvent = RaiseSubtraction;

            calcEvent(this, c);
        }
 void HandleHistory(object sender, CalculationArgs e)
 {
     InputHistory.GetInstance().ViewHistory();
 }
Esempio n. 14
0
        protected virtual void OnMultiplication(CalculationArgs c)
        {
            EventHandler <CalculationArgs> calcEvent = RaiseMultiplication;

            calcEvent(this, c);
        }
Esempio n. 15
0
        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.");
 }
Esempio n. 17
0
        protected virtual void OnPower(CalculationArgs c)
        {
            EventHandler <CalculationArgs> calcEvent = RaiseSquare;

            calcEvent(this, c);
        }
Esempio n. 18
0
        protected virtual void OnDivision(CalculationArgs c)
        {
            EventHandler <CalculationArgs> calcEvent = RaiseDivision;

            calcEvent(this, c);
        }