ManagedFusion.Serialization.Serializer.SerializeName C# (CSharp) Méthode

SerializeName() private méthode

Serializes the name.
private SerializeName ( MemberInfo member ) : string
member System.Reflection.MemberInfo The member.
Résultat string
        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;
        }