Exemple #1
0
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            var newXml = _xml.Element(binder.Name);

            result = new DynamicXml(newXml);
            return(newXml != null);
        }
Exemple #2
0
        private static IEnumerable <Person> ReadXmlDynamic()
        {
            dynamic document = new DynamicXml("people.xml");

            foreach (var record in document.Records)
            {
                yield return(new Person {
                    Name = record.Name, Country = record.Country
                });
            }
        }