public CollectionHandlerWrapper(CollectionHandler handler, Type collectionType, Type itemType) { if (handler == null) throw new ArgumentNullException("handler"); _innerHandler = handler; _collectionType = collectionType; _itemType = itemType; }
public CollectionHandlerWrapper(CollectionHandler handler, Type collectionType, Type itemType) { if (handler == null) { throw new ArgumentNullException("handler"); } _innerHandler = handler; _collectionType = collectionType; _itemType = itemType; }
/// <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; }
public CollectionHandlerWrapper(CollectionHandler handler) { _innerHandler = handler; }
/// <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); }