private XmlAttributes GetAttributes(Type type, bool canBeSimpleType) { XmlAttributes attrs = _attributeOverrides[type]; if (attrs != null) return attrs; if (canBeSimpleType && TypeScope.IsKnownType(type)) { return _defaultAttributes; } return new XmlAttributes(type.GetTypeInfo()); }