예제 #1
0
 // the public method called by the driver
 public double DoSum(int theValue)
 {
     if (theComputer == null)
     {
         GenerateCode(theValue);
     }
     return(theComputer.ComputeSum());
 }
예제 #2
0
        // check if the interface is null
        // if so, call Setup.
        public double DoSum(int theValue)
        {
            if (theComputer == null)
            {
                GenerateCode(theValue);
            }

            // call the method through the interface
            return(theComputer.ComputeSum());
        }