public DataContractBinaryPlistSerializer(Type type)
{
if (type == null)
{
throw new ArgumentNullException("type", "type cannot be null.");
}
this.isDictionary = typeof(IDictionary).IsAssignableFrom(type);
if (!this.isDictionary && type.IsCollection())
{
throw new ArgumentException("root type cannot be a collection unless it is an IDictionary implementation.", "type");
}
if (type.IsPrimitiveOrEnum())
{
throw new ArgumentException("type must be an implementation of IDictionary or a complex object type.", "type");
}
this.rootType = type;
this.typeCache = new Dictionary<Type, TypeCacheItem>();
}