示例#1
0
        static void Main(string[] args)
        {
            ClassInvoker inv    = new ClassInvoker();
            IExecute     exeObj = inv.CheckUsingCommandDesignPattern("Print");

            exeObj.CmdExecute();

            Console.ReadKey();
        }
示例#2
0
        public IExecute CheckUsingCommandDesignPattern(string strCmd)
        {
            IExecute cmdObj = null;

            foreach (IExecute obj in _objList)
            {
                if (obj.strCommand == strCmd)
                {
                    cmdObj = obj;
                    break;
                }
            }

            return(cmdObj);
        }