コード例 #1
0
        /// <summary>
        /// Loads data with common configuration.
        /// </summary>
        private void loadData()
        {
            try
            {
                var config     = new Config();
                var userConfig = new UserConfig();
                Settings.CfgManager.addAndUse(config, userConfig, ContextType.Common);

                config.load();
                Log.Trace("Config Link: '{0}'", config.Link);

                userConfig.load();
                Log.Trace("UserConfig Link: '{0}'", userConfig.Link);
            }
            catch (Exception ex) {
                Log.Fatal("Can't load data with common configuration: '{0}'", ex.Message);
                throw;
            }
        }
コード例 #2
0
        /// <summary>
        /// Solution has been opened.
        /// </summary>
        /// <param name="pUnkReserved">Reserved for future use.</param>
        /// <param name="fNewSolution">true if the solution is being created. false if the solution was created previously or is being loaded.</param>
        /// <returns>If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code.</returns>
        public int solutionOpened(object pUnkReserved, int fNewSolution)
        {
            Config     config     = new Config();
            UserConfig userConfig = new UserConfig();

            bool isNew = !config.load(Environment.SolutionPath, Environment.SolutionFileName);

            Log.Trace("Config Link: '{0}'", config.Link);

            userConfig.load(config.Link);
            Log.Trace("UserConfig Link: '{0}'", userConfig.Link);

            ConfigManager.add(config, ContextType.Solution);
            ConfigManager.add(userConfig, ContextType.Solution);

            ConfigManager.switchOn((isNew || userConfig.Data.Global.IgnoreConfiguration)? ContextType.Common : ContextType.Solution);

            refreshComponents();
            Action.Cmd.MSBuild.initPropByDefault();

            OpenedSolution(this, new EventArgs());
            return(VSConstants.S_OK);
        }