public CollectionHandlerWrapper(CollectionHandler handler, Type collectionType, Type itemType)
        {
            if (handler == null)
                throw new ArgumentNullException("handler");

            _innerHandler = handler;
            _collectionType = collectionType;
            _itemType = itemType;
        }
Beispiel #2
0
 /// <summary>
 /// Registers a collection handler which provides support for a certain type
 /// or multiple types of collections.
 /// </summary>
 /// <param name="handler">the collection handler</param>
 public void RegisterCollectionHandler(CollectionHandler handler)
 {
     _collectionHandlers.Insert(0, handler);
 }
 public CollectionHandlerWrapper(CollectionHandler handler)
 {
     _innerHandler = handler;
 }
Beispiel #4
0
 /// <summary>
 /// Returns true if this type is a collection type
 /// </summary>
 /// <param name="context">the serialization context</param>
 /// <returns>true if a collection</returns>
 public virtual bool IsCollection()
 {
     if (!collectionLookedUp)
     {
         collectionHandler = FindCollectionHandler();
         collectionLookedUp = true;
     }
     return collectionHandler != null;
 }