Example #1
0
        private void InitialiseProjectSettings(IProject project)
        {
            Lifetime projectLifetime;

            if (!myProjectLifetimes.TryGetValue(project, out projectLifetime))
            {
                return;
            }

            SettingsStorageMountPoint mountPoint;

            lock (myProjectMountPoints)
            {
                // There's already a mount point, we're already initialised
                if (myProjectMountPoints.TryGetValue(project, out mountPoint))
                {
                    return;
                }

                mountPoint = CreateMountPoint(projectLifetime, project, mySettingsStorageProviders, myLocks, myLogger,
                                              myInterned);
                myProjectMountPoints.Add(projectLifetime, project, mountPoint);
            }

            InitialiseSettingValues(project, mountPoint);

            // Just to make things more interesting, the langversion cache isn't
            // necessarily updated by the time we get called, so wire up a callback
            myUnityProjectFileCache.RegisterDataChangedCallback(projectLifetime, project.ProjectFileLocation,
                                                                () => InitialiseSettingValues(project, mountPoint));
        }
Example #2
0
        public void InitialiseProjectSettings(Lifetime projectLifetime, IProject project,
                                              ISettingsStorageMountPoint mountPoint)
        {
            SetProjectLangVersion(project, mountPoint);

            // If the project data cache isn't ready yet, or changes at a later date, reset the overridden lang version
            myUnityProjectFileCache.RegisterDataChangedCallback(projectLifetime, project.ProjectFileLocation,
                                                                () => SetProjectLangVersion(project, mountPoint));
        }