VCConfiguration.Evaluate - метод
Evaluates the value of a project model or environment macro. See Macros for Build Commands and Properties for more information about these macros.
Пространство имен: Microsoft.VisualStudio.VCProjectEngine
Сборка: Microsoft.VisualStudio.VCProjectEngine (в Microsoft.VisualStudio.VCProjectEngine.dll)
Синтаксис
'Декларация
Function Evaluate ( _
In As String _
) As String
'Применение
Dim instance As VCConfiguration
Dim In As String
Dim returnValue As String
returnValue = instance.Evaluate(In)
string Evaluate(
string In
)
String^ Evaluate(
[InAttribute] String^ In
)
function Evaluate(
In : String
) : String
Параметры
In
Тип: System.StringRequired. The macro you want to expand.
Возвращаемое значение
Тип: System.String
A string with the expanded macro.
Заметки
If the string you want to evaluate contains no macros, then you get exactly the same string back.
Примеры
See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.
The following example uses Evaluate in the integrated development environment (IDE):
' add reference to Microsoft.VisualStudio.VCProjectEngine.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine
Public Module Module1
Sub Test()
Dim file As VCFile
Dim col As IVCCollection
Dim fileconfig As VCFileConfiguration
Dim strng As String
Dim prj As VCProject
prj = DTE.Solution.Projects.Item(1).Object
col = prj.Files
file = col.Item(1)
col = file.FileConfigurations
fileconfig = col.Item("Debug|Win32")
col = prj.Files
file = col.Item(1)
col = file.FileConfigurations
fileconfig = col.Item("Debug|Win32")
strng = fileconfig.Evaluate("$(TargetDir)")
End Sub
End Module
Разрешения
- Полное доверие для непосредственно вызывающего метода. Этот член не может быть использован частично доверенным кодом. Дополнительные сведения см. в разделе Using Libraries from Partially Trusted Code.