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

            _innerHandler = handler;
            _collectionType = collectionType;
            _itemType = itemType;
        }
Example #2
0
        public CollectionHandlerWrapper(CollectionHandler handler, Type collectionType, Type itemType)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            _innerHandler   = handler;
            _collectionType = collectionType;
            _itemType       = itemType;
        }
Example #3
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)
     {
         if (this.ForType.IsDefined(typeof(JsonExCollectionAttribute), true))
             collectionHandler = GetCollectionHandlerFromAttribute();
         else
             collectionHandler = FindCollectionHandler();
         collectionLookedUp = true;
     }
     return collectionHandler != null;
 }
 /// <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);
 }
Example #5
0
 public CollectionHandlerWrapper(CollectionHandler handler)
 {
     _innerHandler = handler;
 }
 public CollectionHandlerWrapper(CollectionHandler handler)
 {
     _innerHandler = handler;
 }