Exemple #1
0
        /// <summary>
        /// Walk the given member.
        /// </summary>
        internal static void Walk(ReachableContext context, AbstractReference member)
        {
            if (member == null)
                return;

            ClassFile classFile;
            FieldDefinition field;
            MethodDefinition method;
            TypeReference typeRef;
            if ((classFile = member as ClassFile) != null)
            {
                Walk(context, classFile);
            }
            else if ((method = member as MethodDefinition) != null)
            {
                Walk(context, method);
            }
            else if ((field = member as FieldDefinition) != null)
            {
                Walk(context, field);
            }
            else if ((typeRef = member as TypeReference) != null)
            {
                Walk(context, typeRef);
            }
        }
        /// <summary>
        /// Should we walk through the member for all children?
        /// </summary>
        private static bool ShouldWalk(IReachableContext context, AbstractReference member)
        {
            var typeRef = member as TypeReference;

            if (typeRef == null)
            {
                return(true);
            }
            return(context.Contains(typeRef));
        }
 /// <summary>
 /// Should we walk through the member for all children?
 /// </summary>
 private static bool ShouldWalk(IReachableContext context, AbstractReference member)
 {
     var typeRef = member as TypeReference;
     if (typeRef == null) { return true; }
     return context.Contains(typeRef);
 }