Beispiel #1
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------

        private void WriteArgumentOrCollectionItemCheck(MethodWriterBase writer, Operand <TypeTemplate.TArgument> argument, bool isOutput)
        {
            var  actualType = argument.OperandType.UnderlyingType();
            Type collectionItemType;

            if (actualType.IsCollectionType(out collectionItemType) && !(this is ICheckCollectionTypes))
            {
                using (TypeTemplate.CreateScope <TypeTemplate.TItem>(collectionItemType))
                {
                    writer.ForeachElementIn(argument.CastTo <IEnumerable <TypeTemplate.TItem> >()).Do((loop, item) => {
                        using (TypeTemplate.CreateScope <TypeTemplate.TArgument>(collectionItemType))
                        {
                            OnWriteArgumentCheck(writer, item.CastTo <TypeTemplate.TArgument>(), isOutput);
                        }
                    });
                }
            }
            else
            {
                OnWriteArgumentCheck(writer, argument, isOutput);
            }
        }