Beispiel #1
0
 internal XmlMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access)
 {
     this.scope    = scope;
     this.accessor = accessor;
     this.access   = access;
     this.shallow  = scope == null;
 }
Beispiel #2
0
 internal XmlMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access)
 {
     _scope    = scope;
     _accessor = accessor;
     _access   = access;
     _shallow  = scope == null;
 }
 internal XmlMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access)
 {
     this.scope = scope;
     this.accessor = accessor;
     this.access = access;
     this.shallow = scope == null;
 }
Beispiel #4
0
 internal XmlMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access)
 {
     _scope = scope;
     _accessor = accessor;
     _access = access;
     _shallow = scope == null;
 }
        internal XmlMembersMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access) : base(scope, accessor, access)
        {
            MembersMapping mapping = (MembersMapping)accessor.Mapping !;
            StringBuilder  key     = new StringBuilder();

            key.Append(':');
            _mappings = new XmlMemberMapping[mapping.Members !.Length];
 public ArrayList GetHooks(HookType hookType, XmlMappingAccess dir, HookAction action, Type type, string member)
 {
     if ((dir & XmlMappingAccess.Read) != XmlMappingAccess.None)
     {
         return(this.FindHook(this.ReaderHooks, hookType, action, type, member));
     }
     if ((dir & XmlMappingAccess.Write) != XmlMappingAccess.None)
     {
         return(this.FindHook(this.WriterHooks, hookType, action, type, member));
     }
     throw new Exception("INTERNAL ERROR");
 }
 internal XmlMembersMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access) : base(scope, accessor, access) {
     MembersMapping mapping = (MembersMapping)accessor.Mapping;
     StringBuilder key = new StringBuilder();
     key.Append(":");
     mappings = new XmlMemberMapping[mapping.Members.Length];
     for (int i = 0; i < mappings.Length; i++) {
         if (mapping.Members[i].TypeDesc.Type != null) {
             key.Append(GenerateKey(mapping.Members[i].TypeDesc.Type, null, null));
             key.Append(":");
         }
         mappings[i] = new XmlMemberMapping(mapping.Members[i]);
     }
     SetKeyInternal(key.ToString());
 }
Beispiel #8
0
        internal XmlMembersMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access) : base(scope, accessor, access)
        {
            MembersMapping mapping = (MembersMapping)accessor.Mapping;
            StringBuilder  builder = new StringBuilder();

            builder.Append(":");
            this.mappings = new XmlMemberMapping[mapping.Members.Length];
            for (int i = 0; i < this.mappings.Length; i++)
            {
                if (mapping.Members[i].TypeDesc.Type != null)
                {
                    builder.Append(XmlMapping.GenerateKey(mapping.Members[i].TypeDesc.Type, null, null));
                    builder.Append(":");
                }
                this.mappings[i] = new XmlMemberMapping(mapping.Members[i]);
            }
            base.SetKeyInternal(builder.ToString());
        }
Beispiel #9
0
        internal XmlMembersMapping(TypeScope scope, ElementAccessor accessor, XmlMappingAccess access) : base(scope, accessor, access)
        {
            MembersMapping mapping = (MembersMapping)accessor.Mapping;
            StringBuilder  key     = new StringBuilder();

            key.Append(":");
            mappings = new XmlMemberMapping[mapping.Members.Length];
            for (int i = 0; i < mappings.Length; i++)
            {
                if (mapping.Members[i].TypeDesc.Type != null)
                {
                    key.Append(GenerateKey(mapping.Members[i].TypeDesc.Type, null, null));
                    key.Append(":");
                }
                mappings[i] = new XmlMemberMapping(mapping.Members[i]);
            }
            SetKeyInternal(key.ToString());
        }
Beispiel #10
0
        /// <include file='doc\SoapReflectionImporter.uex' path='docs/doc[@for="SoapReflectionImporter.ImportMembersMapping3"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
        {
            ElementAccessor element = new ElementAccessor();

            element.IsSoap = true;
            element.Name   = elementName == null || elementName.Length == 0 ? elementName : XmlConvert.EncodeLocalName(elementName);

            element.Mapping          = ImportMembersMapping(members, ns, hasWrapperElement, writeAccessors, validate, new RecursionLimiter());
            element.Mapping.TypeName = elementName;
            element.Namespace        = element.Mapping.Namespace == null ? ns : element.Mapping.Namespace;
            element.Form             = XmlSchemaForm.Qualified;
            XmlMembersMapping xmlMapping = new XmlMembersMapping(_typeScope, element, access);

            xmlMapping.IsSoap             = true;
            xmlMapping.GenerateSerializer = true;
            return(xmlMapping);
        }
		XmlMembersMapping ImportMembersMapping (string elementName, 
			string ns, 
			XmlReflectionMember[] members, 
			bool hasWrapperElement, 
			bool writeAccessors, 
			bool validate,
			XmlMappingAccess access)
		{
//			Reset ();	Disabled. See ChangeLog

			ArrayList mapping = new ArrayList ();
			for (int n=0; n<members.Length; n++)
			{
				if (members[n].XmlAttributes.XmlIgnore) continue;
				XmlTypeMapMember mapMem = CreateMapMember (null, members[n], ns);
				mapMem.GlobalIndex = n;
				mapMem.CheckOptionalValueType (members);
				mapping.Add (new XmlMemberMapping (members[n].MemberName, ns, mapMem, false));
			}
			elementName = XmlConvert.EncodeLocalName (elementName);
			XmlMembersMapping mps = new XmlMembersMapping (elementName, ns, hasWrapperElement, false, (XmlMemberMapping[])mapping.ToArray (typeof(XmlMemberMapping)));
			mps.RelatedMaps = relatedMaps;
			mps.Format = SerializationFormat.Literal;
			Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null;
#if !NET_2_1
			mps.Source = new MembersSerializationSource (elementName, hasWrapperElement, members, false, true, ns, extraTypes);
			if (allowPrivateTypes) mps.Source.CanBeGenerated = false;
#endif
			return mps;
		}
 public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
 {
 }
 public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
 {
 }
 public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool openModel, XmlMappingAccess access);
Beispiel #15
0
		XmlMembersMapping ImportMembersMapping (string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
		{
			elementName = XmlConvert.EncodeLocalName (elementName);
			XmlMemberMapping[] mapping = new XmlMemberMapping[members.Length];
			for (int n=0; n<members.Length; n++)
			{
				XmlTypeMapMember mapMem = CreateMapMember (members[n], ns);
				mapping[n] = new XmlMemberMapping (XmlConvert.EncodeLocalName (members[n].MemberName), ns, mapMem, true);
			}
			XmlMembersMapping mps = new XmlMembersMapping (elementName, ns, hasWrapperElement, writeAccessors, mapping);
			mps.RelatedMaps = relatedMaps;
			mps.Format = SerializationFormat.Encoded;
			Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null;
			mps.Source = new MembersSerializationSource (elementName, hasWrapperElement, members, writeAccessors, false, null, extraTypes);
			return mps;
		}
 /// <include file='doc\XmlReflectionImporter.uex' path='docs/doc[@for="XmlReflectionImporter.ImportMembersMapping3"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 /// 
 public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool openModel, XmlMappingAccess access) {
     ElementAccessor element = new ElementAccessor();
     element.Name = elementName == null || elementName.Length == 0 ? elementName : XmlConvert.EncodeLocalName(elementName);
     element.Namespace = ns;
     MembersMapping membersMapping = ImportMembersMapping(members, ns, hasWrapperElement, rpc, openModel);
     element.Mapping = membersMapping;
     element.Form = XmlSchemaForm.Qualified;   // elements within soap:body are always qualified
     if (!rpc) {
         if (hasWrapperElement)
             element = (ElementAccessor)ReconcileAccessor(element, this.elements);
         else {
             foreach (MemberMapping mapping in membersMapping.Members) {
                 if (mapping.Elements != null && mapping.Elements.Length > 0) {
                     mapping.Elements[0] = (ElementAccessor)ReconcileAccessor(mapping.Elements[0], this.elements);
                 }
             }
         }
     }
     XmlMembersMapping xmlMapping = new XmlMembersMapping(typeScope, element, access);
     xmlMapping.GenerateSerializer = true;
     return xmlMapping;
 }
 public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool openModel, XmlMappingAccess access)
 {
 }
		public ArrayList GetHooks (HookType hookType, XmlMappingAccess dir, HookAction action, Type type, string member)
		{
			if ((dir & XmlMappingAccess.Read) != 0)
				return FindHook (ReaderHooks, hookType, action, type, member);
			if ((dir & XmlMappingAccess.Write) != 0)
				return FindHook (WriterHooks, hookType, action, type, member);
			else
				throw new Exception ("INTERNAL ERROR");
		}
		XmlMembersMapping ImportMembersMapping (string elementName, 
			string ns, 
			XmlReflectionMember[] members, 
			bool hasWrapperElement, 
			bool writeAccessors, 
			bool validate,
			XmlMappingAccess access)
		{
//			Reset ();	Disabled. See ChangeLog

			XmlMemberMapping[] mapping = new XmlMemberMapping[members.Length];
			for (int n=0; n<members.Length; n++)
			{
				XmlTypeMapMember mapMem = CreateMapMember (null, members[n], ns);
				mapping[n] = new XmlMemberMapping (members[n].MemberName, ns, mapMem, false);
			}
			elementName = XmlConvert.EncodeLocalName (elementName);
			XmlMembersMapping mps = new XmlMembersMapping (elementName, ns, hasWrapperElement, false, mapping);
			mps.RelatedMaps = relatedMaps;
			mps.Format = SerializationFormat.Literal;
			Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null;
			mps.Source = new MembersSerializationSource (elementName, hasWrapperElement, members, false, true, ns, extraTypes);
			if (allowPrivateTypes) mps.Source.CanBeGenerated = false;
			return mps;
		}
 public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool rpc, bool openModel, XmlMappingAccess access)
 {
     ElementAccessor accessor = new ElementAccessor {
         Name = ((elementName == null) || (elementName.Length == 0)) ? elementName : XmlConvert.EncodeLocalName(elementName),
         Namespace = ns
     };
     MembersMapping mapping = this.ImportMembersMapping(members, ns, hasWrapperElement, rpc, openModel, new RecursionLimiter());
     accessor.Mapping = mapping;
     accessor.Form = XmlSchemaForm.Qualified;
     if (!rpc)
     {
         if (hasWrapperElement)
         {
             accessor = (ElementAccessor) this.ReconcileAccessor(accessor, this.elements);
         }
         else
         {
             foreach (MemberMapping mapping2 in mapping.Members)
             {
                 if ((mapping2.Elements != null) && (mapping2.Elements.Length > 0))
                 {
                     mapping2.Elements[0] = (ElementAccessor) this.ReconcileAccessor(mapping2.Elements[0], this.elements);
                 }
             }
         }
     }
     return new XmlMembersMapping(this.typeScope, accessor, access) { GenerateSerializer = true };
 }
        XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
        {
            elementName = XmlConvert.EncodeLocalName(elementName);
            XmlMemberMapping[] mapping = new XmlMemberMapping[members.Length];
            for (int n = 0; n < members.Length; n++)
            {
                XmlTypeMapMember mapMem = CreateMapMember(members[n], ns);
                mapping[n] = new XmlMemberMapping(XmlConvert.EncodeLocalName(members[n].MemberName), ns, mapMem, true);
            }
            XmlMembersMapping mps = new XmlMembersMapping(elementName, ns, hasWrapperElement, writeAccessors, mapping);

            mps.RelatedMaps = relatedMaps;
            mps.Format      = SerializationFormat.Encoded;
            Type[] extraTypes = includedTypes != null ? (Type[])includedTypes.ToArray(typeof(Type)) : null;
            mps.Source = new MembersSerializationSource(elementName, hasWrapperElement, members, writeAccessors, false, null, extraTypes);
            return(mps);
        }
Beispiel #22
0
        public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
        {
            ElementAccessor accessor = new ElementAccessor {
                IsSoap  = true,
                Name    = ((elementName == null) || (elementName.Length == 0)) ? elementName : XmlConvert.EncodeLocalName(elementName),
                Mapping = this.ImportMembersMapping(members, ns, hasWrapperElement, writeAccessors, validate, new RecursionLimiter())
            };

            accessor.Mapping.TypeName = elementName;
            accessor.Namespace        = (accessor.Mapping.Namespace == null) ? ns : accessor.Mapping.Namespace;
            accessor.Form             = XmlSchemaForm.Qualified;
            return(new XmlMembersMapping(this.typeScope, accessor, access)
            {
                IsSoap = true, GenerateSerializer = true
            });
        }
        /// <include file='doc\SoapReflectionImporter.uex' path='docs/doc[@for="SoapReflectionImporter.ImportMembersMapping3"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access) {
            ElementAccessor element = new ElementAccessor();
            element.IsSoap = true;
            element.Name = elementName == null || elementName.Length == 0 ? elementName : XmlConvert.EncodeLocalName(elementName);

            element.Mapping = ImportMembersMapping(members, ns, hasWrapperElement, writeAccessors, validate);
            element.Mapping.TypeName = elementName;
            element.Namespace = element.Mapping.Namespace == null ? ns : element.Mapping.Namespace;
            element.Form = XmlSchemaForm.Qualified;
            XmlMembersMapping xmlMapping = new XmlMembersMapping(typeScope, element, access);
            xmlMapping.IsSoap = true;
            xmlMapping.GenerateSerializer = true;
            return xmlMapping;
        }
Beispiel #24
0
        public XmlMembersMapping ImportMembersMapping(string elementName, string ns, XmlReflectionMember[] members, bool hasWrapperElement, bool writeAccessors, bool validate, XmlMappingAccess access)
        {
            elementName = XmlConvert.EncodeLocalName(elementName);
            XmlMemberMapping[] array = new XmlMemberMapping[members.Length];
            for (int i = 0; i < members.Length; i++)
            {
                XmlTypeMapMember mapMem = this.CreateMapMember(members[i], ns);
                array[i] = new XmlMemberMapping(XmlConvert.EncodeLocalName(members[i].MemberName), ns, mapMem, true);
            }
            XmlMembersMapping xmlMembersMapping = new XmlMembersMapping(elementName, ns, hasWrapperElement, writeAccessors, array);

            xmlMembersMapping.RelatedMaps = this.relatedMaps;
            xmlMembersMapping.Format      = SerializationFormat.Encoded;
            Type[] array2 = (this.includedTypes == null) ? null : ((Type[])this.includedTypes.ToArray(typeof(Type)));
            xmlMembersMapping.Source = new MembersSerializationSource(elementName, hasWrapperElement, members, writeAccessors, false, null, array2);
            return(xmlMembersMapping);
        }