Пример #1
0
        public static AirwayPatient Load(string filename)
        {
            var           serializer = new DataContractSerializer(typeof(AirwayPatient));
            AirwayPatient o          = null;

            using (var stream = new MemoryStream(File.ReadAllBytes(filename)))
            {
                o = serializer.ReadObject(stream) as AirwayPatient;
            }

            return(o);
        }
Пример #2
0
        public void Save()
        {
            AirwayPatients airwayPatients = AirwayPatients.Deserialize();

            for (int index = 0; index < airwayPatients.Count; index++)
            {
                AirwayPatient patient = airwayPatients[index];
                if (patient.PatientId == this.PatientId)
                {
                    airwayPatients[index] = this;
                }
            }
            AirwayPatients.Serialize(airwayPatients);
        }