private void UpdateSettingsFileStore()
		{
			var solution = this.dte.Solution;
			if (solution == null)
			{
				this.ClearSettingsFileStore();
				return;
			}

			string solutionSettingsFileName;
			if (this.LoadUserCreatedSettings && File.Exists(this.UserCreatedSettingsPath))
			{
				solutionSettingsFileName = UserCreatedSettingsPath;
			}
			else if(File.Exists(solution.FullName + WorkspaceSettingsFileSuffix))
			{
				solutionSettingsFileName = solution.FullName + WorkspaceSettingsFileSuffix;
			}
			else
			{
				this.ClearSettingsFileStore();
				return;
			}

			if (this.settingsFileStore != null && solution.FullName == this.settingsFilePath)
			{
				// We are current. Return.
				return;
			}

			try
			{
				// Initialize the new store from that settings file.
				this.settingsFileStore = new WorkspaceBoilerplateSettingsStore(solutionSettingsFileName);
				this.fileSettings = new BoilerplateSettings(this.settingsFileStore);
				this.settingsFilePath = solution.FullName;
			}
			catch
			{
				this.ClearSettingsFileStore();
			}
		}
Esempio n. 2
0
        private void UpdateWorkspaceStore()
        {
            var solution = this.dte.Solution;

            if (solution == null)
            {
                this.ClearWorkspaceStore();
                return;
            }

            string solutionSettingsFileName = solution.FullName + WorkspaceSettingsFileSuffix;

            if (!File.Exists(solutionSettingsFileName))
            {
                this.ClearWorkspaceStore();
                return;
            }

            if (this.workspaceStore != null && solution.FullName == this.workspaceStoreSolutionPath)
            {
                // We are current. Return.
                return;
            }

            try
            {
                // Initialize the new store from that settings file.
                this.workspaceStore             = new WorkspaceBoilerplateSettingsStore(solutionSettingsFileName);
                this.workspaceSettings          = new BoilerplateSettings(this.workspaceStore);
                this.workspaceStoreSolutionPath = solution.FullName;
            }
            catch
            {
                this.ClearWorkspaceStore();
            }
        }
Esempio n. 3
0
 private void ClearWorkspaceStore()
 {
     this.workspaceStoreSolutionPath = null;
     this.workspaceStore             = null;
     this.workspaceSettings          = null;
 }
		public void ClearSettingsFileStore()
		{
			this.settingsFilePath = null;
			this.settingsFileStore = null;
			this.fileSettings = null;
		}