共用方式為


SolutionContext.PlatformName 屬性

取得此指派支援的平台名稱。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property PlatformName As String
string PlatformName { get; }
property String^ PlatformName {
    String^ get ();
}
abstract PlatformName : string
function get PlatformName () : String

屬性值

型別:System.String
字串,代表此指派支援的平台名稱。

備註

如果專案不支援任何平台,PlatformName 會傳回空字串。

範例

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);
}

.NET Framework 安全性

請參閱

參考

SolutionContext 介面

EnvDTE 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例