XML Deserialize from TextReader - CSharp System.Xml

CSharp examples for System.Xml:XML Serialization

Description

XML Deserialize from TextReader

Demo Code


using System.Xml.Serialization;
using System.Xml;
using System.Text;
using System.IO;//ww  w .j  ava2 s . c om
using System.Collections.Generic;
using System.Collections;
using System;

public class Main{
        public static T Deserialize<T>(TextReader reader)
        {
            XmlSerializer s = new XmlSerializer( typeof( T ) );
            return (T)s.Deserialize( reader );
        }
}

Related Tutorials