public void PersistData(SerializationDataLists dataLists) { PersistPersons(dataLists); PersistCompanies(dataLists); PersistChanceries(dataLists); PersistDirectors(dataLists); PersistSecretaries(dataLists); PersistMainSecretaries(dataLists); PersistDocuments(dataLists); PersistCompanyTypes(dataLists); PersistDocumentTypes(dataLists); PersistMarkers(dataLists); }
public void InitializeData(SerializationDataLists dataLists) { InitializePersons(dataLists); InitializeCompanies(dataLists); InitializeChanceries(dataLists); InitializeDirectors(dataLists); InitializeSecretaries(dataLists); InitializeMainSecretaries(dataLists); InitializeDocuments(dataLists); InitializeCompanyTypes(dataLists); InitializeDocumentTypes(dataLists); InitializeMarkers(dataLists); }
private SerializationDataStorage() { DataLists = new SerializationDataLists(); InitializePersons(DataLists); InitializeCompanies(DataLists); InitializeChanceries(DataLists); InitializeDirectors(DataLists); InitializeSecretaries(DataLists); InitializeMainSecretaries(DataLists); InitializeDocuments(DataLists); InitializeCompanyTypes(DataLists); InitializeDocumentTypes(DataLists); InitializeMarkers(DataLists); }
public void InitializeCompanies(SerializationDataLists dataLists) { string filename = ConfigurationManager.AppSettings["CompaniesSerializationFileName"]; BinaryFormatter formatter = new BinaryFormatter(); if (File.Exists(filename)) { List <Company> companies; using (FileStream fs = new FileStream(filename, FileMode.Open)) { companies = (List <Company>)formatter.Deserialize(fs); } dataLists.Companies = companies; } }
public void InitializePersons(SerializationDataLists dataLists) { string filename = ConfigurationManager.AppSettings["PersonsSerializationFileName"]; BinaryFormatter formatter = new BinaryFormatter(); if (File.Exists(filename)) { List <Person> persons; using (FileStream fs = new FileStream(filename, FileMode.Open)) { persons = (List <Person>)formatter.Deserialize(fs); } dataLists.Persons = persons; } }
public void InitializeMarkers(SerializationDataLists dataLists) { string filename = ConfigurationManager.AppSettings["MarkersSerializationFileName"]; BinaryFormatter formatter = new BinaryFormatter(); if (File.Exists(filename)) { List <Marker> markers; using (FileStream fs = new FileStream(filename, FileMode.Open)) { markers = (List <Marker>)formatter.Deserialize(fs); } dataLists.Markers = markers; } }
public void InitializeDocumentTypes(SerializationDataLists dataLists) { string filename = ConfigurationManager.AppSettings["DocumentTypesSerializationFileName"]; BinaryFormatter formatter = new BinaryFormatter(); if (File.Exists(filename)) { List <DocumentType> documentTypes; using (FileStream fs = new FileStream(filename, FileMode.Open)) { documentTypes = (List <DocumentType>)formatter.Deserialize(fs); } dataLists.DocumentTypes = documentTypes; } }
public void PersistMarkers(SerializationDataLists dataLists) { string filename = ConfigurationManager.AppSettings["MarkersSerializationFileName"]; BinaryFormatter formatter = new BinaryFormatter(); if (File.Exists(filename)) { using (FileStream fs = new FileStream(filename, FileMode.OpenOrCreate)) { if (dataLists.Markers != null) { formatter.Serialize(fs, dataLists.Markers); } } } }