Exemplo n.º 1
0
 // This method runs the inner functions for calculation and calls the subscribers
 public double Calculate(double value)
 {
     this.result = this.CalculateRecursively(this.funcComp.Last, value); // call method with the last node
     // if not null then invoke the function inside with the parameter 'result'
     OnCalculate?.Invoke(this, result);                                  // Raise the event
     return(this.result);
 }
Exemplo n.º 2
0
        public double Calculate(double value)
        {
            double res = mission(value);

            OnCalculate?.Invoke(this, res);
            return(res);
        }
Exemplo n.º 3
0
 //Calculate the value using a single function.
 public double Calculate(double value)
 {
     value = calcDelegate(value);
     //notify all those who are subscribed to the event.
     OnCalculate?.Invoke(this, value);
     return(value);
 }
Exemplo n.º 4
0
        /**
         * Calculate and return the result of the mission with the received value,
         * And invoke the event if its not null.
         **/
        public double Calculate(double value)
        {
            double answer = singleMission(value);

            OnCalculate?.Invoke(this, answer);
            return(answer);
        }
Exemplo n.º 5
0
        public double Calculate(double value)
        {
            double ans = this.func(value);  // calculat the mission

            OnCalculate?.Invoke(this, ans); //if the onCalculat isnt null
            return(ans);
        }
Exemplo n.º 6
0
        public double Calculate(double value)
        {
            double returnVal = funcMission(value);

            OnCalculate?.Invoke(this, returnVal);
            return(returnVal);
        }
Exemplo n.º 7
0
        /// <summary>
        /// The function get a double, calculate by the calculate function,
        /// and return the a
        /// </summary>
        /// <param name="value">number as input (double)</param>
        /// <returns>numbner as return value (double)</returns>
        public double Calculate(double value)
        {
            double ans = calculateFunc(value);

            OnCalculate?.Invoke(this, ans);
            return(ans);
        }
        /// <summary>
        /// the execute part of the command design pattern.
        /// also activates the EventHandler.
        /// this method calculates the final result
        /// </summary>
        /// <param name="value"></param>
        /// <returns>the value after calculated</returns>
        public double Calculate(double value)
        {
            double result = this.mission.Invoke(value);

            OnCalculate?.Invoke(this, result); //activates event handler
            return(result);
        }
Exemplo n.º 9
0
        public event EventHandler <double> OnCalculate;  // An Event of when a mission is activated

        /// <summary>
        /// calculates the value.
        /// </summary>
        /// <param name="value"></param>
        /// <returns> returnes the value after operating the function.
        /// </returns>
        public double Calculate(double value)
        {
            double funcValue = missionFunction(value);

            OnCalculate?.Invoke(this, funcValue);
            return(funcValue);
        }
Exemplo n.º 10
0
        public double Calculate(double value)
        {
            double result = operation(value);

            OnCalculate?.Invoke(this, result);
            return(result);
        }
        public double Calculate(double value)
        {
            double rtr = func(value);       //calculate by the single function we have

            OnCalculate?.Invoke(this, rtr); //the events are now being running
            return(rtr);
        }
        public override double Calculate(double value)
        {
            value = base.Calculate(value);

            OnCalculate?.Invoke(this, value);
            return(value);
        }
Exemplo n.º 13
0
        public double Calculate(double value)
        {
            double val = delegateFunc(value);

            OnCalculate?.Invoke(this, val);
            return(val);
        }
Exemplo n.º 14
0
 // This method runs the inner function for calculation and calls the subscribers
 public double Calculate(double value)
 {
     this.result = this.func(value);
     // if not null then invoke the function inside with the parameter 'result'
     OnCalculate?.Invoke(this, this.result); // raise the event
     return(this.result);
 }
Exemplo n.º 15
0
 //calculate function.
 public double Calculate(double value)
 {
     value = Action(value);
     //invoking the event handler.
     OnCalculate?.Invoke(this, value);
     return(value);
 }
Exemplo n.º 16
0
        /// <summary>
        /// The Calculate Function
        /// which gets as a parameter
        /// a double value
        /// and calculates the expression value
        /// given the value from the parameters
        /// and returns the expression value
        /// for it.
        /// Before each return it calls the functions
        /// which OnCalculate EventHandler points to.
        /// It's only if it points to at least
        /// one function.
        /// <param name="value">double value to which we calculate
        /// the expression value</para>
        /// <retValue>double the expression value for
        /// the given value from the parameters</retValue>
        /// </summary>
        public double Calculate(double value)
        {
            double returnValue = Func(value);

            OnCalculate?.Invoke(this, returnValue);
            return(returnValue);
        }
Exemplo n.º 17
0
        // When this function is activate it activates the function from
        // it's member.
        public double Calculate(double value)
        {
            double result = this.thisFunc(value);

            OnCalculate?.Invoke(this, result);
            return(result);
        }
Exemplo n.º 18
0
        /* This method calculates the new value using the function
         * and returns it. Also it invokes calculation event.
         */
        public double Calculate(double value)
        {
            double newValue = function(value);

            OnCalculate.Invoke(this, newValue);
            return(function(newValue));
        }
Exemplo n.º 19
0
        public double Calculate(double value)
        {
            double result = functionMission(value);

            OnCalculate?.Invoke(this, result);
            return(result);
        }
Exemplo n.º 20
0
        /*calculate the mission (use the function and invoke the
         * event handler about the soloution*/
        public double Calculate(double val)
        {
            double newval = this.function(val);

            OnCalculate?.Invoke(this, newval);
            return(newval);
        }
Exemplo n.º 21
0
        // calculate the mission.
        public double Calculate(double var)
        {
            double result = mis(var);

            OnCalculate?.Invoke(this, mis(var));
            return(result);
        }
Exemplo n.º 22
0
 public double Calculate(double value)
 {
     // if the event isn't null run it.
     OnCalculate?.Invoke(this, function(value));
     // calculate the return value.
     return(function(value));
 }
Exemplo n.º 23
0
        /**
         * calculate the delegate based on double input.
         */
        public double Calculate(double d)
        {
            double result = delegate1(d);

            OnCalculate?.Invoke(this, result);
            return(result);
        }
Exemplo n.º 24
0
 //calculates the value with given value and by the function
 public double Calculate(double value)
 {
     value = sfunction(value);
     //raise the event
     OnCalculate?.Invoke(this, value);
     return(value);
 }
        /// <summary>
        /// Calculate - calvulate value by its mission
        /// </summary>
        /// <param name="value"></param>
        /// <returns>result (type: double)</returns>
        public double Calculate(double value)
        {
            double result = func(value);

            //invoke event if not empty
            OnCalculate?.Invoke(this, result);
            return(result);
        }
Exemplo n.º 26
0
        //calculates the mission
        public double Calculate(double value)
        {
            double myVal = this.myDel(value);

            //if not null - Raise the event
            OnCalculate?.Invoke(this, myVal);
            return(myVal);
        }
Exemplo n.º 27
0
        //calculates the function with the input value
        public double Calculate(double value)
        {
            double result = funcMission(value);

            //if there are an events, invoke
            OnCalculate?.Invoke(this, result);
            return(result);
        }
Exemplo n.º 28
0
 // Calculates the value of the function.
 public double Calculate(double val)
 {
     // Calculate the value.
     val = CalcDel(val);
     // Notify everyone.
     OnCalculate?.Invoke(this, val);
     return(val);
 }
Exemplo n.º 29
0
        /*override*/
        public double Calculate(double value)
        {
            double x = funcToCalc(value);

            //raise the event.
            OnCalculate?.Invoke(this, x);
            return(x);
        }
Exemplo n.º 30
0
        /**
         * Invokes the calculate method on a given value, and returns the result of
         * the specific single mission.
         **/
        public double Calculate(double value)
        {
            //put in result the value and invoke the event handler.
            double result = this.mathFunctionPtr(value);

            OnCalculate?.Invoke(this, result);
            return(result);
        }