Beispiel #1
0
        private void AddMetaOsmElement <T>()
        {
            var elementType = typeof(T);
            var properties  = OsmParserHelper.GetOsmProperties(elementType);

            _metaOsmElements.Add(elementType, properties);
        }
Beispiel #2
0
        private void ApplyAttributes(XmlAttributeCollection attributes, object obj)
        {
            var osmProperties = _metaOsmElements[obj.GetType()];

            foreach (XmlAttribute rootAttribute in attributes)
            {
                var attrName  = rootAttribute.Name;
                var attrValue = rootAttribute.Value;

                if (osmProperties.ContainsKey(attrName))
                {
                    var property = osmProperties[attrName];
                    OsmParserHelper.SetValue(obj, property, attrValue);
                }
            }
        }