public void AddListener(PsdzContext psdzContext) { RemoveListener(); this.PsdzProgressListener = new PsdzProgressListener(this.EventManager); this.psdz.AddPsdzProgressListener(this.PsdzProgressListener); this.VehicleProgrammingEventHandler = new VehicleProgrammingEventHandler(ProgrammingInfos, psdzContext); this.psdz.AddPsdzEventListener(this.VehicleProgrammingEventHandler); }
public VehicleProgrammingEventHandler(EcuProgrammingInfos ecuProgrammingInfos, PsdzContext psdzContext, bool ecusSeveralTimesPossible = false) { this.psdzContext = psdzContext; this.diagAddrToEcuMap = new Dictionary <long, EcuProgrammingInfo>(); if (!ecusSeveralTimesPossible) { using (IEnumerator <IEcuProgrammingInfo> enumerator = ecuProgrammingInfos.GetEnumerator()) { while (enumerator.MoveNext()) { IEcuProgrammingInfo ecuProgrammingInfo = enumerator.Current; EcuProgrammingInfo ecuProgrammingInfo2 = (EcuProgrammingInfo)ecuProgrammingInfo; if (!this.diagAddrToEcuMap.ContainsKey(ecuProgrammingInfo2.Ecu.ID_SG_ADR)) { this.diagAddrToEcuMap.Add(ecuProgrammingInfo2.Ecu.ID_SG_ADR, ecuProgrammingInfo2); } } return; } } this.FillEcusIfSeveralTimesPossible(ecuProgrammingInfos); }