コード例 #1
0
        protected XmlPropertyMapExpression InitializeMap(PropertyInfo propertyInfo, XmlMapTarget target, string xpath = "")
        {
            var map = new XmlPropertyMap(propertyInfo, target);

            // Default the name if we don't have one for value
            if (string.IsNullOrEmpty(xpath) && target == XmlMapTarget.Value)
            {
                xpath = propertyInfo.Name;
            }

            map.XPath = xpath;

            this.Mappings.Add(map);

            return(new XmlPropertyMapExpression(map));
        }
コード例 #2
0
 /// <summary>
 /// Creates a new instance of the <see cref="XmlPropertyMap" /> class.
 /// </summary>
 /// <param name="info">PropertyInfo to use.</param>
 /// <param name="target"></param>
 public XmlPropertyMap(PropertyInfo info, XmlMapTarget target)
 {
     this.Info   = info;
     this.Target = target;
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of the <see cref="XmlPropertyMap" /> class.
 /// </summary>
 /// <param name="info">PropertyInfo to use.</param>
 /// <param name="target"></param>
 public XmlPropertyMap(PropertyInfo info, XmlMapTarget target)
 {
     this.Info = info;
     this.Target = target;
 }