Cilador.Clone.CloningExtensions.IsNestedWithin C# (CSharp) Method

IsNestedWithin() private method

private IsNestedWithin ( this type, Mono.Cecil.TypeDefinition possibleAncestorType ) : bool
type this
possibleAncestorType Mono.Cecil.TypeDefinition
return bool
        public static bool IsNestedWithin(this TypeReference type, TypeDefinition possibleAncestorType)
        {
            if (type == null) { return false; }

            while (type.DeclaringType != null)
            {
                if (type.DeclaringType.Resolve().FullName == possibleAncestorType.FullName) { return true; }
                type = type.DeclaringType;
            }

            return false;
        }