System.Runtime.Serialization.XmlObjectSerializer.CheckNull C# (CSharp) Method

CheckNull() static private method

static private CheckNull ( object obj, string name ) : void
obj object
name string
return void
        internal static void CheckNull(object obj, string name)
        {
            if (obj == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(name));
        }

Usage Example

コード例 #1
0
 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;
 }
All Usage Examples Of System.Runtime.Serialization.XmlObjectSerializer::CheckNull