예제 #1
0
        private void VisitType(Type type)
        {
            this.visited.Add(type);

            var nsArgs = new NameSpaceEventArgs
            {
                NameSpaceName = NameSpace(type),
                Comment       = Comment(type)
            };

            var typeArgs = GetTypeEventArgs(type);

            if (NameSpaceVisiting != null)
            {
                NameSpaceVisiting(this, nsArgs);
            }
            if (TypeVisiting != null)
            {
                TypeVisiting(this, typeArgs);
            }

            foreach (var property in type.GetProperties())
            {
                VisitProperty(property, type);
            }

            foreach (var field in type.GetFields())
            {
                VisitField(field, type);
            }

            foreach (var member in type.GetMethods())
            {
                VisitMethod(member, type);
            }

            if (TypeVisited != null)
            {
                TypeVisited(this, typeArgs);
            }
            if (NameSpaceVisited != null)
            {
                NameSpaceVisited(this, nsArgs);
            }
        }
예제 #2
0
        private void VisitType(Type type)
        {
            this.visited.Add(type);

            var nsArgs = new NameSpaceEventArgs
            {
                NameSpaceName = NameSpace(type),
                Comment = Comment(type)
            };

            var typeArgs = GetTypeEventArgs(type);

            if (NameSpaceVisiting != null) { NameSpaceVisiting(this, nsArgs); }
            if (TypeVisiting != null) { TypeVisiting(this, typeArgs);  }

            foreach (var property in type.GetProperties())
            {
                VisitProperty(property, type);
            }

            foreach (var field in type.GetFields())
            {
                VisitField(field, type);
            }

            foreach (var member in type.GetMethods())
            {
                VisitMethod(member, type);
            }

            if (TypeVisited != null)  { TypeVisited(this, typeArgs);  }
            if (NameSpaceVisited != null) { NameSpaceVisited(this, nsArgs); }
        }