private void OnViewExported(List <ILibraryEntity> entities, string path, FileStorageType storageType)
 {
     if (storageType == FileStorageType.Raw)
     {
         rawFileRepository.Export(entities, path);
     }
     if (storageType == FileStorageType.Xml)
     {
         xmlRepository.Export(entities, path);
     }
 }
 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));
     }
 }
示例#3
0
 private void OnImported(Type arg1, string arg2, FileStorageType arg3)
 {
     Imported?.Invoke(arg1, arg2, arg3);
     OnDataUpdated(arg1);
 }
示例#4
0
 public FileReference(FileStorageType storageType, string reference)
 {
     StorageType = storageType;
     Reference   = reference;
 }
示例#5
0
 private void OnExported(List <ILibraryEntity> arg1, string arg2, FileStorageType arg3)
 {
     Exported?.Invoke(arg1, arg2, arg3);
 }