static int Main(string[] args) { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(UnhandledThreadExceptionHandler); //ObjectStore.WaitForThenBlockBackgroundThreads(10000); try { if (!CommandLine.Parser.Default.ParseArguments(args, options)) { Console.WriteLine("Invalid command line options: {0}", options.GetUsage()); return(-1); } ScheduleEntriesInjector.InjectReplacementScheduleEntriesMethods(); //MergeProgramsInjector.ReplaceMergePrograms(); MergeProgramsInjector.ReplaceCheckIfProgramsMatch(); // new SchedulerWorkerInjector().ReplaceThreadSetup(); StoredObjectsEnumeratorInjector.ReplaceUpdate(); ObjectStore objStore = Util.object_store; MxfImporter.Import(new StreamReader(options.inputMxfPath).BaseStream, Util.object_store, MxfImportProgressCallback); Console.WriteLine("Waiting for any background threads to complete."); Util.WaitForBackgroundThreads(); } catch (Exception e) { Console.WriteLine("Exception occurred: {0} {1}", e, e.StackTrace); return(-1); } if (options.reindexWhenDone) { reindexDatabase(); } return(0); }
internal static void ImportMxf() { BuildMxf(); MxfImporter.Import(new StreamReader("mxf.xml").BaseStream, ChannelEditing.object_store, MxfImportProgressCallback); //ChannelEditing.object_store.Import("mxf.xml", MxfImportProgressCallback); /* using (var xmlReader = XmlReader.Create("mxf.xml")) * { * MxfImporter.Import(xmlReader, ChannelEditing.object_store); * } */ }