コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        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;
            }
        }
コード例 #8
0
        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);
                    }
                }
            }
        }