예제 #1
0
        static void Main(string[] args)
        {
            IDataObject dtObj  = DataObject.CreateDataObjec2(10, 6);
            int         result = dtObj.Compute();

            Console.ReadLine();
        }
예제 #2
0
        /// <summary>
        /// 拦截对 Compute 方法的调用;
        /// </summary>
        /// <returns></returns>
        public int Compute()
        {
            DoSomethingBeforeCompute();

            int result = _realObject.Compute();

            DoSomethingAfterCompute(result);

            return(result);
        }