Microsoft.VisualStudio.Project.ConfigProvider.GetCfgNames C# (CSharp) Method

GetCfgNames() public method

Returns the existing configurations stored in the project file.
public GetCfgNames ( uint celt, string names, uint actual ) : int
celt uint Specifies the requested number of property names. If this number is unknown, can be zero.
names string On input, an allocated array to hold the number of configuration property names specified by . This parameter can also be a reference if the parameter is zero. /// On output, names contains configuration property names.
actual uint The actual number of property names returned.
return int
        public virtual int GetCfgNames(uint celt, string[] names, uint[] actual)
        {
            // get's called twice, once for allocation, then for retrieval
            int i = 0;

            string[] configList = GetPropertiesConditionedOn(ProjectFileConstants.Configuration);

            if(names != null)
            {
                foreach(string config in configList)
                {
                    names[i++] = config;
                    if(i == celt)
                        break;
                }
            }
            else
                i = configList.Length;

            if(actual != null)
            {
                actual[0] = (uint)i;
            }

            return VSConstants.S_OK;
        }