VCCodeStruct.AddImplementedInterface 方法

將介面加入至繼承之物件的清單中。

命名空間:  Microsoft.VisualStudio.VCCodeModel
組件:  Microsoft.VisualStudio.VCCodeModel (在 Microsoft.VisualStudio.VCCodeModel.dll 中)

語法

'宣告
Function AddImplementedInterface ( _
    Base As Object, _
    Position As Object _
) As CodeInterface
CodeInterface AddImplementedInterface(
    Object Base,
    Object Position
)
CodeInterface^ AddImplementedInterface(
    Object^ Base, 
    Object^ Position
)
abstract AddImplementedInterface : 
        Base:Object * 
        Position:Object -> CodeInterface 
function AddImplementedInterface(
    Base : Object, 
    Position : Object
) : CodeInterface

參數

  • Position
    型別:System.Object
    選擇項。預設値 = 0。其後要加入新項目的程式碼項目。如果這個值是 CodeElement,則會緊接在其後加入新項目。
    如果這個值是長資料型別,那麼 AddImplementedInterface 會指示其後要加入新項目的項目。
    由於集合是從 1 開始計算,傳遞 0 表示新的項目必須放在集合起始的位置。值為 -1 時表示這個項目必須放在集合結尾的位置。

傳回值

型別:EnvDTE.CodeInterface
CodeInterface 物件。

備註

AddImplementedInterface 會加入對 CodeClass 承諾會實作的介面的參考。AddImplementedInterface 不會插入介面成員的方法 Stub。

Visual C++ 必須以冒號分隔 (::) 的格式做為其完整的型別名稱。其他所有語言都支援句號 (.) 分隔的格式。

引數的正確性取決於程式碼模型後的程式語言。

.NET Framework 安全性

請參閱

參考

VCCodeStruct 介面

Microsoft.VisualStudio.VCCodeModel 命名空間

其他資源

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