Exemplo n.º 1
0
        internal ProjectConfig(ProjectNode project, string configuration)
        {
            this.project = project;
            if (configuration.Contains("|"))   // If configuration is in the form "<Configuration>|<Platform>"
            {
                string[] configStrArray = configuration.Split('|');
                if (2 == configStrArray.Length)
                {
                    this.configName   = configStrArray[0];
                    this.platformName = configStrArray[1];
                }
                else
                {
                    throw new Exception(string.Format(CultureInfo.InvariantCulture, "Invalid configuration format: {0}", configuration));
                }
            }
            else   // If configuration is in the form "<Configuration>"
            {
                this.configName = configuration;
            }

            var flavoredCfgProvider = ProjectMgr.GetOuterInterface <IVsProjectFlavorCfgProvider>();

            Utilities.ArgumentNotNull("flavoredCfgProvider", flavoredCfgProvider);
            ErrorHandler.ThrowOnFailure(flavoredCfgProvider.CreateProjectFlavorCfg(this, out flavoredCfg));
            Utilities.ArgumentNotNull("flavoredCfg", flavoredCfg);

            // if the flavored object support XML fragment, initialize it
            IPersistXMLFragment persistXML = flavoredCfg as IPersistXMLFragment;

            if (null != persistXML)
            {
                this.project.LoadXmlFragment(persistXML, configName, platformName);
            }
        }
Exemplo n.º 2
0
        internal ProjectConfig(ProjectNode project, string configuration)
        {
            this.project    = project;
            this.configName = configuration;

            var flavoredCfgProvider = ProjectMgr.GetOuterInterface <IVsProjectFlavorCfgProvider>();

            Utilities.ArgumentNotNull("flavoredCfgProvider", flavoredCfgProvider);
            ErrorHandler.ThrowOnFailure(flavoredCfgProvider.CreateProjectFlavorCfg(this, out flavoredCfg));
            Utilities.ArgumentNotNull("flavoredCfg", flavoredCfg);

            // if the flavored object support XML fragment, initialize it
            IPersistXMLFragment persistXML = flavoredCfg as IPersistXMLFragment;

            if (null != persistXML)
            {
                this.project.LoadXmlFragment(persistXML, configName);
            }
        }