private static void LoadMaps() { foreach (var fileName in Directory.GetFiles(UtilitySettings.Default.MapLocation, "*.xml")) { using (var mapFile = File.Open(fileName, FileMode.Open)) { var mapDocument = XDocument.Load(mapFile); switch (MapReader.ReadHandlerType(mapDocument)) { case HandlerType.ModuleRegistration: ModuleRegistrarFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.TypeResolution: TypeResolverFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.LibraryReader: LibraryReaderFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.Verification: NodeVerifierFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.Translation: ArtifactTranslatorFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.NodeTranslation: NodeTranslatorFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.ModelTranslation: ModelTranslatorFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.Writing: ArtifactWriterFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; } } } }
private static void RegisterModules() { foreach (var moduleRegistrar in ModuleRegistrarFactory.GetHandlers()) { foreach (var o in moduleRegistrar.Register()) { OperatorMap.Core.RegisterOperator(o); } } }