Exemplo n.º 1
0
        public static dynamic ToObject(string xml)
        {
            XElement element       = XElement.Parse(xml);
            dynamic  dynamicResult = new DynamicXElement(element);

            return(dynamicResult);
        }
Exemplo n.º 2
0
        public override bool TryGetMember(
            GetMemberBinder binder, out object result)
        {
            XElement getNode = this.XContent.Element(binder.Name);

            if (getNode != null)
            {
                result = new DynamicXElement(getNode);
            }
            else
            {
                result = new DynamicXElement(binder.Name);
            }
            return(true);
        }
Exemplo n.º 3
0
        public static string ToXml(dynamic dynamicObject)
        {
            DynamicXElement xmlNode = dynamicObject;

            return(xmlNode.XContent.ToString());
        }