private string SerializeName(MemberInfo member)
{
string name = null;
if (member.IsDefined(typeof(SerializablePropertyAttribute), true))
{
object[] attrs = member.GetCustomAttributes(typeof(SerializablePropertyAttribute), true);
if (attrs.Length > 0)
{
SerializablePropertyAttribute attr = attrs[0] as SerializablePropertyAttribute;
name = (attr.IsAttribute ? AttributeMarker.ToString() : String.Empty) + attr.Name;
}
}
if (String.IsNullOrEmpty(name))
name = null;
return name ?? member.Name;
}