System.Xml.Serialization.XmlSerializationReader.CreateInvalidCastException C# (CSharp) Method

CreateInvalidCastException() protected method

protected CreateInvalidCastException ( Type type, object value, string id ) : Exception
type Type
value object
id string
return Exception
        protected Exception CreateInvalidCastException(Type type, object value, string id)
        {
            if (value == null)
                return new InvalidCastException(SR.Format(SR.XmlInvalidNullCast, type.FullName));
            else if (id == null)
                return new InvalidCastException(SR.Format(SR.XmlInvalidCast, value.GetType().FullName, type.FullName));
            else
                return new InvalidCastException(SR.Format(SR.XmlInvalidCastWithId, value.GetType().FullName, type.FullName, id));
        }

Same methods

XmlSerializationReader::CreateInvalidCastException ( Type type, object value ) : Exception