private void Initialize(Type type, IEnumerable <Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, bool preserveObjectReferences, IDataContractSurrogate dataContractSurrogate)
{
XmlObjectSerializer.CheckNull(type, "type");
this.rootType = type;
if (knownTypes != null)
{
this.knownTypeList = new List <Type>();
foreach (Type type2 in knownTypes)
{
this.knownTypeList.Add(type2);
}
}
if (maxItemsInObjectGraph < 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("maxItemsInObjectGraph", System.Runtime.Serialization.SR.GetString("ValueMustBeNonNegative")));
}
this.maxItemsInObjectGraph = maxItemsInObjectGraph;
this.ignoreExtensionDataObject = ignoreExtensionDataObject;
this.preserveObjectReferences = preserveObjectReferences;
this.dataContractSurrogate = dataContractSurrogate;
}