共用方式為


OutputGroup.CanonicalName 屬性

取得此輸出群組使用的唯一名稱。

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

語法

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

屬性值

型別:System.String
字串,表示輸出群組的使用名稱。

範例

Sub CanonicalNameExample(ByVal dte As DTE2)

    ' Before running this example, open a project.

    ' Display the output groups of the first project.
    Dim proj As Project = dte.Solution.Item(1)
    Dim con As Configuration = _
        proj.ConfigurationManager.ActiveConfiguration
    Dim names As String = ""
    Dim og As OutputGroup
    For Each og In con.OutputGroups
        names &= og.CanonicalName & vbCrLf
    Next

    MsgBox(proj.Name & "'s " & con.ConfigurationName & _
        " output groups:" & vbCrLf & vbCrLf & names)

End Sub
public void CanonicalNameExample(DTE2 dte)
{
    // Before running this example, open a project.

    // Display the output groups of the first project.
    Project proj = dte.Solution.Item(1);
    Configuration con = proj.ConfigurationManager.ActiveConfiguration;
    string names = "";
    foreach (OutputGroup og in con.OutputGroups)
    {
        names += og.CanonicalName + Environment.NewLine;
    }

    MessageBox.Show(proj.Name + "'s " + con.ConfigurationName + 
        " output groups:" + Environment.NewLine + Environment.NewLine + 
        names);
}

.NET Framework 安全性

請參閱

參考

OutputGroup 介面

EnvDTE 命名空間

其他資源

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