Example #1
0
        /// ------------------------------------------------------------------------------------
        public StatisticsViewModel(Project project, PersonInformant personInformant,
                                   SessionWorkflowInformant sessionInformant, IEnumerable <ComponentRole> componentRoles,
                                   AudioVideoDataGatherer backgroundStatisticsMananager)
        {
            ProjectName                 = (project == null ? string.Empty : project.Name);
            ProjectPath                 = (project == null ? string.Empty : project.FolderPath);
            PersonInformant             = personInformant;
            SessionInformant            = sessionInformant;
            _componentRoles             = componentRoles;
            _backgroundStatisticsGather = backgroundStatisticsMananager;
            _backgroundStatisticsGather.NewDataAvailable           += HandleNewStatistics;
            _backgroundStatisticsGather.FinishedProcessingAllFiles += HandleFinishedGatheringStatisticsForAllFiles;

            _chartBuilder = new HTMLChartBuilder(this);
        }
Example #2
0
        /// ------------------------------------------------------------------------------------
        public ProjectContext(string projectSettingsPath, IContainer parentContainer)
        {
            var rootDirectoryPath = Path.GetDirectoryName(projectSettingsPath);

            BuildSubContainerForThisProject(rootDirectoryPath, parentContainer);

            Project = _scope.Resolve <Func <string, Project> >()(projectSettingsPath);

            SetContributorsListToSession(Project.SessionsFolder);

            var peopleRepoFactory = _scope.Resolve <ElementRepository <Person> .Factory>();

            peopleRepoFactory(rootDirectoryPath, Person.kFolderName, _scope.Resolve <PersonFileType>());

            var sessionRepoFactory = _scope.Resolve <ElementRepository <Session> .Factory>();

            sessionRepoFactory(rootDirectoryPath, Session.kFolderName, _scope.Resolve <SessionFileType>());

            // Create background operations
            _presetGatherer            = _scope.Resolve <PresetGatherer>();
            _autoCompleteValueGatherer = _scope.Resolve <AutoCompleteValueGatherer>();
            _audioVideoDataGatherer    = _scope.Resolve <AudioVideoDataGatherer>();
            _fieldGatherer             = _scope.Resolve <FieldGatherer>();

            // Start background operations
            _presetGatherer.Start();
            _autoCompleteValueGatherer.Start();
            _audioVideoDataGatherer.Start();
            _fieldGatherer.Start();

            var view1 = _scope.Resolve <ProjectScreen>();
            var view2 = _scope.Resolve <SessionsListScreen>();
            var view3 = _scope.Resolve <PersonListScreen>();

            var views = new ISayMoreView[]
            {
                view1,
                view2,
                view3
            };

            ProjectWindow = _scope.Resolve <ProjectWindow.Factory>()(projectSettingsPath, views);
        }