System.Xml.Serialization.ReflectionXmlSerializationWriter.IsDefaultValue C# (CSharp) Method

IsDefaultValue() private method

private IsDefaultValue ( TypeMapping mapping, object o, object value, bool isNullable ) : bool
mapping TypeMapping
o object
value object
isNullable bool
return bool
        private bool IsDefaultValue(TypeMapping mapping, object o, object value, bool isNullable)
        {
            if (value is string && ((string)value).Length == 0)
            {
                string str = (string)o;
                return str == null || str.Length == 0;
            }
            else
            {
                return value.Equals(o);
            }
        }