ConfigurationManager.Item 方法

傳回在 ConfigurationManager 集合中的 Configuration 物件。

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

語法

'宣告
Function Item ( _
    index As Object, _
    Platform As String _
) As Configuration
Configuration Item(
    Object index,
    string Platform
)
Configuration^ Item(
    [InAttribute] Object^ index, 
    String^ Platform
)
abstract Item : 
        index:Object * 
        Platform:string -> Configuration 
function Item(
    index : Object, 
    Platform : String
) : Configuration

參數

  • index
    型別:System.Object
    必要項。一個絕對索引、GUID 字串或組態名稱。

傳回值

型別:EnvDTE.Configuration
Configuration 物件。

備註

Item 會傳回 Index 的組態。 這個物件的順序是以資料列為主,資料列是由專案/專案項目組態名稱形成,而資料欄則是由平台名稱形成。

如果 index 是 LONG 資料型別,它就是矩陣中以資料列為主的索引,而 Platform 引數則會被忽略。 如果 index 是字串資料型別,它就是專案/專案項目組態名稱,而且必須提供 Platform 做為平台的名稱。 若是不支援任何平台的專案,這個引數便可能是空字串。

範例

Sub ItemExample()
   ' Before running, load a project.
   ' Set references to all necessary objects.
   Dim CM As ConfigurationManager = DTE.Solution.Projects.Item(1).ConfigurationManager
   ' List the configuration name used for the current project.
   MsgBox(CM.Item(2).ConfigurationName)
End Sub

.NET Framework 安全性

請參閱

參考

ConfigurationManager 介面

EnvDTE 命名空間