public IInvestigation CreateInternal(IInvestigationInfo investigationInfo) { var chidWc = new WindsorContainer($"Investigation-{investigationInfo.InvestigationName}-{investigationInfo.Guid}", new DefaultKernel(), new DefaultComponentInstaller()); this.Container.AddChildContainer(chidWc); chidWc.Register(Component.For <IInvestigationInfo, InvestigationInfo>().Instance(investigationInfo)); chidWc.Register(Component.For <IWindsorContainer, WindsorContainer>().Instance(chidWc)); chidWc.Install(FromAssembly.InDirectory(new AssemblyFilter("."), new InstallerFactoryFilter(typeof(IDetectiveIvestigationWindsorInstaller)))); var investigationInfoToReturn = chidWc.Resolve <IInvestigationFactoryInternal>().CreateInternal(investigationInfo); return(investigationInfoToReturn); }
public async Task <IInvestigation> Create(IInvestigationInfo investigationInfo) { chidWc = new WindsorContainer($"Investigation-{investigationInfo.InvestigationName}-{investigationInfo.Guid}", new DefaultKernel(), new DefaultComponentInstaller()); this.Container.AddChildContainer(chidWc); chidWc.Register(Component.For <IInvestigationInfo, InvestigationInfo>().Instance(investigationInfo)); chidWc.Register(Component.For <IWindsorContainer, WindsorContainer>().Instance(chidWc)); chidWc.Register(Component.For <IDetectiveMessenger>().Instance(this._messenger)); chidWc.Register(Component.For <ISerializationPersistor <Investigation> >().Instance(this._investigationSerializationPersistor)); chidWc.Install(FromAssembly.InDirectory(new AssemblyFilter("."), new InstallerFactoryFilter(typeof(IDetectiveIvestigationWindsorInstaller)))); var investigation = chidWc.Resolve <IInvestigationFactoryInternal>().CreateInternal(investigationInfo); investigationInfo.CreateFileStructure(); await investigation.Initialize(); return(investigation); }
public Investigation(IInvestigationInfo investigationInfo) { this.InvestigationInfo = investigationInfo; this.InvestigationInfo.LastRecentlyUsed = DateTime.UtcNow; this.OperationLogs = new ConcurrentIObservableVirtualizingObservableCollection <OperationLog>(); }
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; }