예제 #1
0
 bool IDeserializar.Xml(string path, out DepositoHeredado deposito)
 {
     try
     {
         XmlTextReader reader = new XmlTextReader(path);
         XmlSerializer seri   = new XmlSerializer(typeof(DepositoHeredado));
         deposito = (DepositoHeredado)seri.Deserialize(reader);
         reader.Close();
         return(true);
     }
     catch (XmlException)
     {
         deposito = null;
         return(false);
     }
 }
예제 #2
0
        bool IDeserializar.Xml(string path, out DepositoHeredado d)
        {
            bool retorno = false;

            try
            {
                XmlTextReader reader = new XmlTextReader(path);
                XmlSerializer seri   = new XmlSerializer(typeof(DepositoHeredado));
                d = (DepositoHeredado)seri.Deserialize(reader);
                reader.Close();
                retorno = true;
            }
            catch (XmlException)
            { d = null; }
            return(retorno);
        }
예제 #3
0
        bool IDeserializar.Xml(string path, out DepositoHeredado dep)
        {
            bool rtn = true;

            dep = new DepositoHeredado();
            try
            {
                XmlTextReader lector = new XmlTextReader(path);
                XmlSerializer serial = new XmlSerializer(typeof(DepositoHeredado));
                dep = (DepositoHeredado)serial.Deserialize(lector);
                lector.Close();
            }
            catch
            {
                rtn = false;
            }
            return(rtn);
        }