コード例 #1
0
 public WorkspacesManagerService(
     IInvestigationFactory investigationFactory,
     IInvestigationInfoLoader investigationInfoLoader,
     IWorkspaceFactory workspaceFactory,
     ILogger logger) : base()
 {
     this.InvestigationFactory    = investigationFactory;
     this.InvestigationInfoLoader = investigationInfoLoader;
     this.WorkspaceFactory        = workspaceFactory;
     this.Logger = logger;
     this.LoadWorkspacesFromSettingsFile();
 }
コード例 #2
0
        public InvestigationsManagerVm(WindsorContainer applicationWindsorContainer) : base(applicationWindsorContainer)
        {
            DispatcherHelper.CheckBeginInvokeOnUI(() => this.View = this.ApplicationOrInvestigationWindsorContainer.Resolve <IInvestigationsManagerView>());

            this.InvestigationFactory              = this.ApplicationOrInvestigationWindsorContainer.Resolve <IInvestigationFactory>();
            this.InvestigationInfoLoader           = this.ApplicationOrInvestigationWindsorContainer.Resolve <IInvestigationInfoLoader>();
            this._fileSystem                       = this.ApplicationOrInvestigationWindsorContainer.Resolve <IFileSystem>();
            this._investigatSerializationPersistor = this.ApplicationOrInvestigationWindsorContainer.Resolve <ISerializationPersistor <Investigation> >();
            this._messenger = this.ApplicationOrInvestigationWindsorContainer.Resolve <IDetectiveMessenger>();
            this._messenger.Register <OpenedInvestigationMessage>(this, this.OpenedInvestigationMessageReceived);
            this._messenger.Register <OpenedWorkspaceMessage>(this, this.OpenedWorkspaceMessageReceived);
            this._messenger.Register <ClosedWorkspaceMessage>(this, this.ClosedWorkspaceMessageReceived);
            this._messenger.Register <CreatedInvestigationMessage>(this, this.CreatedInvestigationMessageReceived);
            this._messenger.Register <ExitedApplicationMessage>(this, this.ExitedApplicationMessageReceived);
        }
コード例 #3
0
        public NewWorkspaceInvestigationWizardVm(IDirectoryInfoFactory directoryInfoManager, IWindsorContainer applicationWindsorContainer,
                                                 InvestigationInfo investigationInfo, IInvestigationFactory investigationFactory,
                                                 IDetectiveMessenger detectiveMessenger, CreateWorkspaceCommand createWorkspaceCommand, CreateInvestigationCommand createInvestigationCommand) : base(applicationWindsorContainer)
        {
            _createInvestigationCommand = createInvestigationCommand;
            _createWorkspaceCommand     = createWorkspaceCommand;
            _detectiveMessenger         = detectiveMessenger;
            _investigationFactory       = investigationFactory;
            _directoryInfoManager       = directoryInfoManager ?? throw new ArgumentNullException(nameof(directoryInfoManager));
            this.InvestigationInfo      = investigationInfo;
            this.ViewType = typeof(INewWorkspaceInvestionWizardView);
            var ts = DateTime.Now.Millisecond;

            this.SqlConnectionStringBuilder = this.CreateDefaultConnectionStringBuilder();
            this.InvestigationName          = $"Initial investigation - {ts}";
            this.WorkspaceName = $"NFX workspace - {ts}";
        }
コード例 #4
0
        public Workspace(IInvestigationFactory investigationFactory, IInvestigationInfoLoader investigationInfoLoader, string workspaceName, string workspacesStoragePath, string connectionString)
        {
            this.InvestigationFactory    = investigationFactory;
            this.InvestigationInfoLoader = investigationInfoLoader;
            this.Name                   = workspaceName;
            this.ConnectionString       = connectionString;
            this.WorkspaceDirectoryInfo = GetWorkspaceDirectoryInfo(this.Name, workspacesStoragePath);
            if (this.WorkspaceDirectoryInfo.Exists)
            {
                throw new InvalidOperationException("InvestigationWorkspace already exists!");
            }
            this.WorkspaceDirectoryInfo.Create();
            this.Guid             = Guid.NewGuid();
            this.Created          = DateTime.Now;
            this.LastRecentlyUsed = this.Created;

            this.InvestigationsDirectoryInfo.Create();
        }
コード例 #5
0
 public CreateInvestigationCommand(IDetectiveMessenger messenger, IInvestigationFactory investigationFactory)
 {
     this._messenger            = messenger ?? throw new ArgumentNullException(nameof(messenger));
     this._investigationFactory = investigationFactory ?? throw new ArgumentNullException(nameof(investigationFactory));
 }
コード例 #6
0
 public NewWorkspaceInvestigationWizardVm(IDirectoryInfoFactory directoryInfoManager, IWindsorContainer applicationWindsorContainer, Workspace model,
                                          InvestigationInfo investigationInfo, IInvestigationFactory investigationFactory, IDetectiveMessenger detectiveMessenger,
                                          CreateWorkspaceCommand createWorkspaceCommand, CreateInvestigationCommand createInvestigationCommand) : this(directoryInfoManager,
                                                                                                                                                       applicationWindsorContainer, investigationInfo, investigationFactory, detectiveMessenger, createWorkspaceCommand, createInvestigationCommand)
 {
     // workaround: in some cases this constructor is executed even though it should not be
     if (!string.IsNullOrEmpty(model.Name))
     {
         this.Workspace                  = model;
         this.InvestigationName          = "Initial investigation";
         this.WorkspaceName              = model.Name;
         this.SqlConnectionStringBuilder = new SqlConnectionStringBuilder(model.ConnectionString);
     }
 }