SolutionContext.PlatformName Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Возвращает имя платформы, которая поддерживается этим назначением.
public:
property System::String ^ PlatformName { System::String ^ get(); };
public:
property Platform::String ^ PlatformName { Platform::String ^ get(); };
[System.Runtime.InteropServices.DispId(5)]
public string PlatformName { [System.Runtime.InteropServices.DispId(5)] get; }
[<System.Runtime.InteropServices.DispId(5)>]
[<get: System.Runtime.InteropServices.DispId(5)>]
member this.PlatformName : string
Public ReadOnly Property PlatformName As String
Значение свойства
Строка, представляющая имя платформы, которое поддерживается этим назначением.
- Атрибуты
Примеры
Sub PlatformNameExample(ByVal dte As DTE2)
' Before running this example, open a project.
' Display the solution contexts of the Debug configuration.
Dim config As SolutionConfiguration = _
dte.Solution.SolutionBuild.SolutionConfigurations.Item("Debug")
Dim context As SolutionContext
Dim msg As String
msg &= config.Name & " Configuration Project Platforms:" & _
vbCrLf & vbCrLf
For Each context In config.SolutionContexts
msg &= " " & context.ProjectName & " = " & _
context.PlatformName & vbCrLf
Next
MsgBox(msg)
End Sub
public void PlatformNameExample(DTE2 dte)
{
// Before running this example, open a project.
// Display the solution contexts of the Debug configuration.
SolutionConfiguration config =
dte.Solution.SolutionBuild.SolutionConfigurations.Item(
"Debug");
string msg = "";
msg += config.Name + " Configuration Project Platforms:\n\n";
foreach (SolutionContext context in config.SolutionContexts)
msg += " " + context.ProjectName + " = " +
context.PlatformName + "\n";
MessageBox.Show(msg);
}
Комментарии
Если проект не поддерживает платформы, PlatformName возвращается пустая строка.