コード例 #1
0
 private void OnViewImported(Type type, string path, FileStorageType storageType)
 {
     if (type == typeof(Book))
     {
         if (storageType == FileStorageType.Raw)
         {
             bookRepository.Add(rawFileRepository.Import <Book>(path));
         }
         if (storageType == FileStorageType.Xml)
         {
             bookRepository.Add(xmlRepository.Import <Book>(path));
         }
         OnViewDataUpdated(typeof(Book));
     }
     if (type == typeof(Journal))
     {
         if (storageType == FileStorageType.Raw)
         {
             journalRepository.Add(rawFileRepository.Import <Journal>(path));
         }
         if (storageType == FileStorageType.Xml)
         {
             journalRepository.Add(xmlRepository.Import <Journal>(path));
         }
         OnViewDataUpdated(typeof(Journal));
     }
     if (type == typeof(Newspaper))
     {
         if (storageType == FileStorageType.Raw)
         {
             newspaperRepository.Add(rawFileRepository.Import <Newspaper>(path));
         }
         if (storageType == FileStorageType.Xml)
         {
             newspaperRepository.Add(xmlRepository.Import <Newspaper>(path));
         }
         OnViewDataUpdated(typeof(Newspaper));
     }
 }