Exemplo n.º 1
0
        public PerProjectSettings(Lifetime lifetime, IViewableProjectsCollection projects,
                                  ISettingsSchema settingsSchema,
                                  SettingsStorageProvidersCollection settingsStorageProviders, IShellLocks locks,
                                  ILogger logger, InternKeyPathComponent interned,
                                  LangVersionCacheProvider langVersionCache)
        {
            this.settingsSchema = settingsSchema;
            this.logger         = logger;
            myLangVersionCache  = langVersionCache;
            projects.Projects.View(lifetime, (projectLifetime, project) =>
            {
                if (!project.IsUnityProject())
                {
                    return;
                }

                var mountPoint = CreateMountPoint(projectLifetime, project, settingsStorageProviders, locks, logger, interned);
                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
                myLangVersionCache.RegisterDataChangedCallback(projectLifetime, project.ProjectFileLocation,
                                                               () => InitialiseSettingValues(project, mountPoint));
            });
        }
Exemplo n.º 2
0
        public PerProjectSettings(Lifetime lifetime, ISolution solution, ChangeManager changeManager,
                                  ModuleReferenceResolveSync moduleReferenceResolveSync,
                                  IViewableProjectsCollection projects,
                                  ISettingsSchema settingsSchema,
                                  SettingsStorageProvidersCollection settingsStorageProviders, IShellLocks locks,
                                  ILogger logger, InternKeyPathComponent interned,
                                  LangVersionCacheProvider langVersionCache)
        {
            mySolution                 = solution;
            myChangeManager            = changeManager;
            this.settingsSchema        = settingsSchema;
            mySettingsStorageProviders = settingsStorageProviders;
            myLocks              = locks;
            this.logger          = logger;
            myInterned           = interned;
            myLangVersionCache   = langVersionCache;
            myProjectMountPoints = new Dictionary <IProject, SettingsStorageMountPoint>();
            myProjectLifetimes   = new Dictionary <IProject, Lifetime>();

            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, this, moduleReferenceResolveSync);

            projects.Projects.View(lifetime, (projectLifetime, project) =>
            {
                myProjectLifetimes.Add(project, projectLifetime);

                if (!project.IsUnityProject())
                {
                    return;
                }

                InitialiseProjectSettings(project);
            });
        }