src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/PropertyPages/BuildMacroInfo.cs
/// <summary>
/// Retrieves the value or body of a macro based on the macro's name.
/// </summary>
/// <param name="bstrBuildMacroName">String containing the name of the macro.</param>
/// <param name="pbstrBuildMacroValue">String containing the value or body of the macro.</param>
/// <returns>If the method succeeds, it returns S_OK. If it fails, it returns an error code.</returns>
Retrieves the value or body of a macro based on the macro's name.
Retrieves the value or body of a macro based on the macro ' s name .
public int GetBuildMacroValue(string bstrBuildMacroName, out string pbstrBuildMacroValue)
        {
            pbstrBuildMacroValue = null;
            var commonProperties = _configuredProject.Value.Services.ProjectPropertiesProvider.GetCommonProperties();
            pbstrBuildMacroValue = _threadingService.ExecuteSynchronously(() => commonProperties.GetEvaluatedPropertyValueAsync(bstrBuildMacroName));
            if (pbstrBuildMacroValue == null)
            {
                pbstrBuildMacroValue = string.Empty;
                return VSConstants.E_FAIL;
            }
            else
            {
                return VSConstants.S_OK;
            }
        }
public int GetBuildMacroValue ( string bstrBuildMacroName , out string pbstrBuildMacroValue ) { pbstrBuildMacroValue = null ; var commonProperties = _configuredProject . Value . Services . ProjectPropertiesProvider . GetCommonProperties ( ) ; pbstrBuildMacroValue = _threadingService . ExecuteSynchronously ( ( ) => commonProperties . GetEvaluatedPropertyValueAsync ( bstrBuildMacroName ) ) ; if ( pbstrBuildMacroValue == null ) { pbstrBuildMacroValue = string . Empty ; return VSConstants . E_FAIL ; } else { return VSConstants . S_OK ; } }
Retrieves the value or body of a macro based on the macro's name.
Retrieves the value or body of a macro based on the macro ' s name .
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
If the method succeeds it returns S_OK . If it fails it returns an error code .
bstrBuildMacroName
string
String containing the name of the macro.
String containing the name of the macro .
string
out
pbstrBuildMacroValue
String containing the value or body of the macro.
String containing the value or body of the macro .