Esempio n. 1
0
            private bool HasRuntimeActionRecursive(Stack <Type> typeStack, int recursionLevel)
            {
                if (_actionInfo != null)
                {
                    return(true);
                }

                if (recursionLevel > 3 && typeStack.Contains(this._type))
                {
                    return(false); //breaks recursion
                }

                typeStack.Push(this._type);
                try
                {
                    if (_runtimeCollectionElementInfo?.HasRuntimeActionRecursive(typeStack, recursionLevel + 1) == true)
                    {
                        return(true);
                    }

                    foreach (var runtimeMember in _runtimeMembers)
                    {
                        if (runtimeMember.RuntimeInfo?.HasRuntimeActionRecursive(typeStack, recursionLevel + 1) == true)
                        {
                            return(true);
                        }
                    }

                    return(false);
                }
                finally
                {
                    typeStack.Pop();
                }
            }