internal ATMap(ATMMain mapper) { getFunction = GetWithInitialization; thisFactory = this as IATMFactory <T>; thisValidate = this as IATMValidate; this.mapper = mapper; this.baseType = typeof(T); constructorParameters = new Dictionary <string, IGeneratorFunc>(); }
public ATMSystem(IATMFactory factory, ITransponderReceiver transponderReceiver) { //Calling factory methods receiver = transponderReceiver; _airSpace = factory.CreateAirSpace(); _condition = factory.CreateCondition(); _consolePrinter = factory.CreateConsolePrinter(); _logger = factory.CreateLogger(); _separationChecker = factory.CreateSeparationChecker(); //Subscribing to events this.receiver.TransponderDataReady += ReceiverOnTransponderReady; this.SeparationLogDataReady += _logger.SeparationLogDataHandler; this.ConsoleSeparationDataReady += _consolePrinter.ConsoleSeparationDataHandler; }
private bool TryGetFirstMapForType(Type type, List <IATMap> chain, out IATMFactory map) { map = null; var maps = mapper.GetMapsForType(type); if (maps == null) { return(false); } mapper.AssertOnlyOneMap(maps); var firstMap = maps[0]; if (!(firstMap as IATMValidate).Validate(chain)) { return(false); } map = firstMap; return(true); }