public void Init() { persister = new DatabasePersister(); try { persister.Load(); } catch (Exception) { //BUG IN EF } _target = (string)typeof(DatabasePersister).GetField( "_originalTarget", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(persister); }
protected override void registerSerializers() { DatabasePersister <Mixer> .RegisterSerializer(new MixerInputXmlSerializer()); }
protected override void registerSerializers() { DatabasePersister <Macro> .RegisterSerializer(new MacroCommandWithArgumentsXmlSerializer()); DatabasePersister <Macro> .RegisterSerializer(new MacroTriggerWithArgumentsXmlSerializer()); }
protected override void registerSerializers() { DatabasePersister <Router> .RegisterSerializer(new LeitchRouterOutputXmlSerializer()); }
protected override void registerSerializers() { DatabasePersister <Labelset> .RegisterSerializer(new LabelXmlSerializer()); }
protected override void registerSerializers() { DatabasePersister <Salvo> .RegisterSerializer(new SalvoCrosspointXmlSerializer()); }
static void Main(string[] args) { if (args.Length != 1) { Console.WriteLine("The path to folder with HTML files must be supplied ..."); Console.ReadLine(); return; } var folderName = args[0]; var managers = ManagerProvisioner.Create(); var clients = ClientParser.Parse(folderName); Console.WriteLine("Successfully parsed clients. Count = " + clients.Count()); var contacts = ContactsParser.Parse(folderName); Console.WriteLine("Successfully parsed contacts. Count = " + contacts.Count()); var textMessages = TextMessagesParser.Parse(folderName); Console.WriteLine("Successfully parsed text messages. Count = " + textMessages.Count()); var identityDocuments = IdentityDocumentsParser.Parse(folderName); Console.WriteLine("Successfully parsed identity documents. Count = " + identityDocuments.Count()); var identityDocumentImages = IdentityDocumentImagesParser.Parse(folderName); Console.WriteLine("Successfully parsed identity document images. Count = " + identityDocumentImages.Count()); var archiveDocuments = ArchiveDocumentsParser.Parse(folderName); Console.WriteLine("Successfully parsed archive documents. Count = " + archiveDocuments.Count()); var archiveDocumentImages = ArchiveDocumentImagesParser.Parse(folderName); Console.WriteLine("Successfully parsed archive document images. Count = " + archiveDocumentImages.Count()); var oldIdentityDocumentIds = identityDocuments.ToDictionary(x => x, x => x.Id); var oldArchiveDocumentIds = archiveDocuments.ToDictionary(x => x, x => x.Id); Console.WriteLine(); Console.WriteLine("----- Parsing finished -----"); Console.WriteLine(); Console.WriteLine("Press ENTER to continue ..."); Console.ReadLine(); Console.WriteLine(); clients = ClientValidator.Check(clients); Console.WriteLine("Clients are checked successfully"); contacts = ContactValidator.Check(clients, contacts); Console.WriteLine("Contacts are checked successfully"); textMessages = TextMessageValidator.Check(clients, textMessages); Console.WriteLine("Text Messages are checked successfully"); identityDocuments = IdentityDocumentValidator.Check(clients, identityDocuments); Console.WriteLine("Identity Documents are checked successfully"); identityDocumentImages = IdentityDocumentImageValidator.Check(folderName, identityDocuments, identityDocumentImages); Console.WriteLine("Identity Document Images are checked successfully"); archiveDocuments = ArchiveDocumentValidator.Check(clients, archiveDocuments); Console.WriteLine("Archive Documents are checked successfully"); archiveDocumentImages = ArchiveDocumentImageValidator.Check(folderName, archiveDocuments, archiveDocumentImages); Console.WriteLine("Archieve Document Images are checked successfully"); Console.WriteLine(); Console.WriteLine("----- Checking finished -----"); Console.WriteLine(); Console.WriteLine("Press ENTER to continue ..."); Console.ReadLine(); Console.WriteLine(); using (var databasePersister = new DatabasePersister()) { databasePersister.Save(managers); Console.WriteLine("Managers are saved succesfully"); var sw = new Stopwatch(); sw.Start(); databasePersister.Save(clients); Console.WriteLine("Clients are saved succesfully"); databasePersister.Save(contacts); Console.WriteLine("Contacts are saved succesfully"); databasePersister.Save(textMessages); Console.WriteLine("Text Messages are saved succesfully"); databasePersister.Save(identityDocuments); Console.WriteLine("Identity Documents are saved succesfully"); databasePersister.Save(identityDocumentImages); Console.WriteLine("Identity Documents Images are saved succesfully"); databasePersister.Save(archiveDocuments); Console.WriteLine("Archive Documents are saved succesfully"); databasePersister.Save(archiveDocumentImages); Console.WriteLine("Archive Documents Images are saved succesfully"); sw.Stop(); Console.WriteLine("StopWatch - {0}", sw.Elapsed.TotalSeconds); } Console.WriteLine(); Console.WriteLine("----- Saving to the database finished -----"); Console.WriteLine(); Console.WriteLine("Press ENTER to continue ..."); Console.ReadLine(); Console.WriteLine(); var blobPersister = new BlobPersister(folderName); Console.WriteLine("Identity Documents Images are being uploaded"); blobPersister.Save(oldIdentityDocumentIds, identityDocumentImages); Console.WriteLine("Archive Documents Images are being uploaded"); blobPersister.Save(oldArchiveDocumentIds, archiveDocumentImages); Console.WriteLine(); Console.WriteLine("----- Uploading to BLOB storage finished -----"); Console.WriteLine(); Console.WriteLine("Press ENTER to finish ..."); Console.ReadLine(); Console.WriteLine(); }
protected override void registerSerializers() { DatabasePersister <RouterMirror> .RegisterSerializer(new RouterMirrorInputAssociationXmlSerializer()); DatabasePersister <RouterMirror> .RegisterSerializer(new RouterMirrorOutputAssociationXmlSerializer()); }
protected override void registerSerializers() { DatabasePersister <MacroPanel> .RegisterSerializer(new MacroPanelElementXmlSerializer()); }
protected override void registerSerializers() { DatabasePersister <Router> .RegisterSerializer(new BmdVideohubOutputXmlSerializer()); }