Пример #1
0
        public CollectionSequence(CollectionDefinition collectionDefinition)
            : base(collectionDefinition)
        {
            if (collectionDefinition == null) throw new ArgumentNullException("collectionDefinition");

            collectionDef = collectionDefinition;
        }
Пример #2
0
        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());
            }
        }
Пример #3
0
 protected object GetTypedValue(CollectionDefinition collectionDefinition)
 {
     object collection = collectionDefinition.ConstructNew();
     PopulateCollection(collectionDefinition, collection);
     return collection;
 }