public void SetUp() { base.SetUpInMemory(); this.SnooperExports = this.WindsorContainer.Resolve <VirtualizingObservableDBSetPagedCollection <SnooperExportBase> >(); this.SnooperExports.IsNotifyImmidiately = true; this.SnooperFactory = this.WindsorContainer.Resolve <ISnooperFactory>(); this.AvailableSnoopersTypes = this.SnooperFactory.AvailableSnoopersTypes; this.AvailableSnoopers = this.SnooperFactory.AvailableSnoopers; }
public ExportService(IWindsorContainer investigationWindsorContainer, IFrameworkController frameworkController, IInvestigationInfo investigationInfo, ISnooperFactory snooperFactory, VirtualizingObservableDBSetPagedCollection <ExportGroup> exportGroups) : base() { this.InvestigationWindsorContainer = investigationWindsorContainer; this.FrameworkController = frameworkController; this.InvestigationInfo = investigationInfo; this.SnooperFactory = snooperFactory; var snooperToExportGroupDictionary = new Dictionary <Type, ExportGroup>(); foreach (var snooper in this.SnooperFactory.AvailableSnoopers) { try { var exportGroup = exportGroups.FirstOrDefault(g => g.Name == snooper.Name && g.Parent == null); if (exportGroup == null) { var snooperExportObjectType = snooper.PrototypExportObject.GetType(); exportGroup = new ExportGroup(snooperExportObjectType, this.InvestigationWindsorContainer) { Name = snooper.Name }; exportGroups.Add(exportGroup); } snooperToExportGroupDictionary.Add(snooper.PrototypExportObject.GetType(), exportGroup); } catch (Exception ex) { this.Logger?.Error("Cannot create export groups", ex); Debugger.Break(); } } this.SnooperToExportGroupDictionary = snooperToExportGroupDictionary; }