public XmlAttributeConfiguration([NotNull] IXmlSerializerConfiguration config,
                                  [NotNull] XmlElementTarget rootTarget, [NotNull] XmlElementTarget target,
                                  [NotNull] SimpleMapper<XmlElementContext> mapper, [NotNull] Type targetType)
 {
     _config = config;
     _rootTarget = rootTarget;
     _target = target;
     _mapper = mapper;
     _targetType = targetType;
 }
        public XmlMapper(string?membername, Type targetType, SimpleConverter <string>?converter,
                         XmlElementTarget target)
            : base(membername, targetType)
        {
            if (converter == null && TargetMember != null)
            {
                converter = ConverterFactory.CreateConverter(TargetMember, MemberType);
            }

            _serializer = new XmlElementSerializer(target, converter);
        }
Example #3
0
        public XmlListMapper(string?membername, Type targetType, XmlElementTarget rootTarget, XmlElementTarget target, SimpleConverter <string>?converter)
            : base(membername, targetType)
        {
            _rootTarget = rootTarget;

            if (MemberType != null)
            {
                _listBuilder = new ListBuilder(MemberType);
            }

            if (converter == null && _listBuilder != null)
            {
                converter = ConverterFactory.CreateConverter(TargetMember, _listBuilder.ElemenType);
            }

            _serializer = new XmlElementSerializer(target, converter);
        }
 public XmlElementSerializer([NotNull] XmlElementTarget target, [NotNull] SimpleConverter<string> converter)
 {
     _target = target;
     _converter = converter;
 }