示例#1
0
 /// <summary>
 /// Mark the given reference reachable
 /// </summary>
 internal static void MarkReachable(this MemberReference memberRef, IReachableContext context)
 {
     if ((memberRef != null) && (!memberRef.IsReachable))
     {
         memberRef.SetReachable(context);
     }
 }
示例#2
0
 /// <summary>
 /// Mark the given reference reachable
 /// </summary>
 internal static void MarkReachable(this MemberReference memberRef, IReachableContext context, bool useInSerialization = false)
 {
     if (memberRef != null)
     {
         memberRef.SetReachable(context, useInSerialization);
     }
 }
示例#3
0
 /// <summary>
 /// Mark the given reference reachable
 /// </summary>
 internal static void MarkReachable(this MemberReference memberRef, IReachableContext context)
 {
     if ((memberRef != null) && (!memberRef.IsReachable))
     {
         memberRef.SetReachable(context);
     }
 }
示例#4
0
 /// <summary>
 /// Mark the given reference reachable
 /// </summary>
 internal static void MarkReachable(this MemberReference memberRef, IReachableContext context, bool useInSerialization = false)
 {
     if (memberRef != null)
     {
         memberRef.SetReachable(context, useInSerialization);
     }
 }
示例#5
0
        /// <summary>
        /// Mark this type reachable.
        /// </summary>
        public void SetReachable(IReachableContext context, bool useInSerialization = false)
        {
            // Already reachable?
            if (reachable != 0 && (!useInSerialization || usedInSerialization != 0))
            {
                return;
            }

            // Mark it reachable
            bool reachableChanged     = Interlocked.Exchange(ref reachable, 1) == 0;
            bool serializationChanged = useInSerialization && Interlocked.Exchange(ref usedInSerialization, 1) == 0;

            if (reachableChanged || serializationChanged)
            {
                if (context != null)
                {
                    context.NewReachableDetected();

                    // Member was not yet walked, do it now unless its a type that is not in the project
                    if (ShouldWalk(context, this))
                    {
                        context.Walk(this);
                    }
                }
            }
        }
示例#6
0
 /// <summary>
 /// Should we walk through the member for all children?
 /// </summary>
 private static bool ShouldWalk(IReachableContext context, MemberReference member)
 {
     TypeReference typeRef = member as TypeReference;
     if (typeRef == null) { return true; }
     if (typeRef is GenericParameter) { return true; }
     if (typeRef is TypeSpecification) { return true; }
     return context.Contains(typeRef);
 }
示例#7
0
        /// <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));
        }
示例#8
0
        /// <summary>
        /// Should we walk through the member for all children?
        /// </summary>
        private static bool ShouldWalk(IReachableContext context, MemberReference member)
        {
            TypeReference typeRef = member as TypeReference;

            if (typeRef == null)
            {
                return(true);
            }
            if (typeRef is GenericParameter)
            {
                return(true);
            }
            if (typeRef is TypeSpecification)
            {
                return(true);
            }
            return(context.Contains(typeRef));
        }
示例#9
0
        /// <summary>
        /// Mark this type reachable.
        /// </summary>
        public void SetReachable(IReachableContext context)
        {
            // Already reachable?
            if (reachable != 0) { return; }

            // Mark it reachable
            if (Interlocked.Exchange(ref reachable, 1) == 0)
            {
                if (context != null)
                {
                    context.NewReachableDetected();

                    // Member was not yet walked, do it now unless its a type that is not in the project
                    if (ShouldWalk(context, this))
                    {
                        context.Walk(this);
                    }
                }
            }
        }
示例#10
0
        /// <summary>
        /// Mark this type reachable.
        /// </summary>
        public void SetReachable(IReachableContext context)
        {
            // Already reachable?
            if (reachable != 0)
            {
                return;
            }

            // Mark it reachable
            if (Interlocked.Exchange(ref reachable, 1) == 0)
            {
                if (context != null)
                {
                    context.NewReachableDetected();

                    // Member was not yet walked, do it now unless its a type that is not in the project
                    if (ShouldWalk(context, this))
                    {
                        context.Walk(this);
                    }
                }
            }
        }
示例#11
0
 /// <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);
 }