FindSpecifiedMember() static private method

static private FindSpecifiedMember ( string memberName, XmlReflectionMember reflectionMembers ) : XmlReflectionMember
memberName string
reflectionMembers XmlReflectionMember
return XmlReflectionMember
Beispiel #1
0
        private MemberMapping ImportMemberMapping(XmlReflectionMember xmlReflectionMember, string ns, XmlReflectionMember[] xmlReflectionMembers, XmlSchemaForm form, RecursionLimiter limiter)
        {
            SoapAttributes a = xmlReflectionMember.SoapAttributes;

            if (a.SoapIgnore)
            {
                return(null);
            }
            MemberMapping member = new MemberMapping();

            member.IsSoap = true;
            member.Name   = xmlReflectionMember.MemberName;
            bool       checkSpecified = XmlReflectionImporter.FindSpecifiedMember(xmlReflectionMember.MemberName, xmlReflectionMembers) != null;
            FieldModel model          = new FieldModel(xmlReflectionMember.MemberName, xmlReflectionMember.MemberType, _typeScope.GetTypeDesc(xmlReflectionMember.MemberType), checkSpecified, false);

            member.CheckShouldPersist = model.CheckShouldPersist;
            member.CheckSpecified     = model.CheckSpecified;
            member.ReadOnly           = model.ReadOnly; // || !model.FieldTypeDesc.HasDefaultConstructor;
            ImportAccessorMapping(member, model, a, ns, form, limiter);
            if (xmlReflectionMember.OverrideIsNullable)
            {
                member.Elements[0].IsNullable = false;
            }
            return(member);
        }
Beispiel #2
0
        private MemberMapping ImportMemberMapping(XmlReflectionMember xmlReflectionMember, string ns, XmlReflectionMember[] xmlReflectionMembers, XmlSchemaForm form, RecursionLimiter limiter)
        {
            SoapAttributes soapAttributes = xmlReflectionMember.SoapAttributes;

            if (soapAttributes.SoapIgnore)
            {
                return(null);
            }
            MemberMapping accessor = new MemberMapping {
                IsSoap = true,
                Name   = xmlReflectionMember.MemberName
            };
            bool       checkSpecified = XmlReflectionImporter.FindSpecifiedMember(xmlReflectionMember.MemberName, xmlReflectionMembers) != null;
            FieldModel model          = new FieldModel(xmlReflectionMember.MemberName, xmlReflectionMember.MemberType, this.typeScope.GetTypeDesc(xmlReflectionMember.MemberType), checkSpecified, false);

            accessor.CheckShouldPersist = model.CheckShouldPersist;
            accessor.CheckSpecified     = model.CheckSpecified;
            accessor.ReadOnly           = model.ReadOnly;
            this.ImportAccessorMapping(accessor, model, soapAttributes, ns, form, limiter);
            if (xmlReflectionMember.OverrideIsNullable)
            {
                accessor.Elements[0].IsNullable = false;
            }
            return(accessor);
        }