Beispiel #1
0
        public void SalvarContratoCache(ContratoSalvar cont)
        {
            BinaryFormatter formato = new BinaryFormatter();
            Stream          stream  = File.Create(@"Contrato.bin");

            formato.Serialize(stream, cont);
            stream.Close();
        }
Beispiel #2
0
        public ContratoSalvar RecuperarContratoCache()
        {
            BinaryFormatter formato = new BinaryFormatter();
            Stream          stream  = File.OpenRead(@"Contrato.bin");
            ContratoSalvar  cont    = (ContratoSalvar)formato.Deserialize(stream);

            stream.Close();
            return(cont);
        }
Beispiel #3
0
        public void Restaurar(Memento memento)
        {
            ContratoSalvar cont = memento.RecuperarContratoCache();

            CommonBC.Syncronize(cont, this);
        }