コード例 #1
0
        /// <summary>
        /// Start things up so all the collection-specific objects we need can be created.
        /// </summary>
        /// <param name="projectSettingsPath"></param>
        /// <param name="parentContainer"></param>
        /// <param name="justEnoughForHtmlDialog">If true, we're aiming for the minimum init that will
        /// let us display an HTML dialog. Currently this will be the JoinTeamCollection dialog.
        /// We need the BloomServer running (so we can make API requests, including for localization).
        /// We can avoid a lot of other expensive stuff.</param>
        public ProjectContext(string projectSettingsPath, IContainer parentContainer, bool justEnoughForHtmlDialog = false)
        {
            SettingsPath = projectSettingsPath;
            // BL-8019: A couple lines down, BuildSubContainerForThisProject() starts BloomServer with the new project.
            // While we are starting (or restarting, in the case of switching collections) BloomServer we need to use
            // the WinFormsExceptionHandler mechanism, which doesn't use a browser.
            // The ProblemReportApi, which uses the browser (and therefore BloomServer) isn't available to us
            // while BloomServer is starting up. By the time WorkspaceView comes online and sets the error reporting
            // to the ProblemReportApi mechanism, BloomServer will be up and running again.
            ErrorReport.OnShowDetails         = null;
            FatalExceptionHandler.UseFallback = true;

            BuildSubContainerForThisProject(projectSettingsPath, parentContainer);

            _scope.Resolve <CollectionSettings>().CheckAndFixDependencies(_scope.Resolve <BloomFileLocator>());

            if (!justEnoughForHtmlDialog)
            {
                ProjectWindow = _scope.Resolve <Shell>();
            }

            string collectionDirectory = Path.GetDirectoryName(projectSettingsPath);

            //should we save a link to this in the list of collections?
            var collectionSettings = _scope.Resolve <CollectionSettings>();

            if (!justEnoughForHtmlDialog && collectionSettings.IsSourceCollection)
            {
                AddShortCutInComputersBloomCollections(collectionDirectory);
            }

            ToolboxView.SetupToolboxForCollection(Settings);
            _scope.Resolve <TeamCollectionManager>().Settings = Settings;
        }
コード例 #2
0
        public ProjectContext(string projectSettingsPath, IContainer parentContainer)
        {
            SettingsPath = projectSettingsPath;
            BuildSubContainerForThisProject(projectSettingsPath, parentContainer);

            _scope.Resolve <CollectionSettings>().CheckAndFixDependencies(_scope.Resolve <BloomFileLocator>());

            ProjectWindow = _scope.Resolve <Shell>();

            string collectionDirectory = Path.GetDirectoryName(projectSettingsPath);

            //should we save a link to this in the list of collections?
            var collectionSettings = _scope.Resolve <CollectionSettings>();

            if (collectionSettings.IsSourceCollection)
            {
                AddShortCutInComputersBloomCollections(collectionDirectory);
            }

            ToolboxView.SetupToolboxForCollection(Settings);
        }