コード例 #1
0
        public void Test()
        {
            var characters = new List <ICharacter>
            {
                new CatInTheHat(),
                new Fish(),
                new Thing()
            };

            var visitor = new FishVisitor();

            foreach (var character in characters)
            {
                visitor.Visit((dynamic)character);
            }
        }
コード例 #2
0
        public void Test()
        {
            var characters = new List<ICharacter>
            {
                new CatInTheHat(),
                new Fish(),
                new Thing()
            };

            var visitor = new FishVisitor();

            foreach (var character in characters)
            {
                visitor.Visit((dynamic)character);
            }
        }