Beispiel #1
0
 private void AgregarLlamada(Llamada nuevaLlamada)
 {
     this._listaDeLlamadas.Add(nuevaLlamada);
     try
     {
         this.GuardarEnArchivo(nuevaLlamada, true);
     }
     catch (Exception e)
     {
         CentralitaException CE = new CentralitaException(e.Message, this.GetType().Name, "Método AgregarLLamada", e);
         Console.WriteLine("La excepción es: {0} - La clase que la causó es: {1} - El método que lo causó es: {2}", CE.ExcepcionInterna.Message, CE.NombreClase, CE.NombreMetodo);
     }
 }
Beispiel #2
0
        public bool Deserializarse() //método implementado de la interfaz ISerializable
        {
            bool aux = false;

            try
            {
                XmlSerializer xs = new XmlSerializer(typeof(Centralita));
                StreamReader  sr = new StreamReader(this.RutaDeArchivo);
                xs.Deserialize(sr);
                sr.Close();
                aux = true;
            }
            catch (Exception e)
            {
                CentralitaException CE = new CentralitaException(e.Message, this.GetType().Name, "Método Deserializarse", e);
                throw CE;
            }
            return(aux);
        }