Microsoft.VisualStudio.Project.ProjectConfig.GetConfigurationProperty C# (CSharp) Method

GetConfigurationProperty() public method

public GetConfigurationProperty ( string propertyName, bool resetCache ) : string
propertyName string
resetCache bool
return string
        public virtual string GetConfigurationProperty(string propertyName, bool resetCache)
        {
            MSBuildExecution.ProjectPropertyInstance property = GetMsBuildProperty(propertyName, resetCache);
            if (property == null)
                return null;

            return property.EvaluatedValue;
        }

Usage Example

Esempio n. 1
0
        // relative to active configuration.
        public string GetConfigProperty(string propertyName)
        {
            if (this.ProjectMgr != null)
            {
                string unifiedResult  = null;
                bool   cacheNeedReset = true;

                for (int i = 0; i < this.projectConfigs.Length; i++)
                {
                    ProjectConfig config   = projectConfigs[i];
                    string        property = config.GetConfigurationProperty(propertyName, cacheNeedReset);
                    cacheNeedReset = false;

                    if (property != null)
                    {
                        string text = property.Trim();

                        if (i == 0)
                        {
                            unifiedResult = text;
                        }
                        else if (unifiedResult != text)
                        {
                            return("");                            // tristate value is blank then
                        }
                    }
                }

                return(unifiedResult);
            }

            return(String.Empty);
        }