CheckNull() static private method

static private CheckNull ( object obj, string name ) : void
obj object
name string
return void
 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;
 }
Exemplo n.º 2
0
 public XmlReaderDelegator(XmlReader reader)
 {
     XmlObjectSerializer.CheckNull(reader, nameof(reader));
     this.reader           = reader;
     this.dictionaryReader = reader as XmlDictionaryReader;
 }
 public XmlWriterDelegator(XmlWriter writer)
 {
     XmlObjectSerializer.CheckNull(writer, nameof(writer));
     this.writer           = writer;
     this.dictionaryWriter = writer as XmlDictionaryWriter;
 }