public CollectionSequence(CollectionDefinition collectionDefinition) : base(collectionDefinition) { if (collectionDefinition == null) throw new ArgumentNullException("collectionDefinition"); collectionDef = collectionDefinition; }
protected void PopulateCollection(CollectionDefinition collectionDefinition, object collection) { if (collection != null) { // Property type might not have an Add method, but the concrete collection will if (!collectionDefinition.CanAdd) collectionDefinition = (CollectionDefinition)TypeCache.GetTypeDefinition(collection); foreach (ObjectOutput value in Items) collectionDefinition.AddToCollection(collection, value.GetTypedValue()); } }
protected object GetTypedValue(CollectionDefinition collectionDefinition) { object collection = collectionDefinition.ConstructNew(); PopulateCollection(collectionDefinition, collection); return collection; }