共用方式為


StandardModelingAdapter.GetElementId 方法 (ModelElement)

 

取得 ModelElement 的項目 ID。這個項目 Id 會用於建立模型項目的 modelbus 參考

命名空間:   Microsoft.VisualStudio.Modeling.Integration
組件:  Microsoft.VisualStudio.Modeling.Sdk.Integration.12.0 (在 Microsoft.VisualStudio.Modeling.Sdk.Integration.12.0.dll 中)

語法

protected virtual string GetElementId(
    ModelElement mel
)
protected:
virtual String^ GetElementId(
    ModelElement^ mel
)
abstract GetElementId : 
        mel:ModelElement -> string
override GetElementId : 
        mel:ModelElement -> string
Protected Overridable Function GetElementId (
    mel As ModelElement
) As String

參數

  • mel
    我們要求項目 Id 的 ModelElement

傳回值

Type: System.String

在配接器所管理之物件當中唯一表示 ModelElement 的字串。

備註

可正常是的預設實作會傳回 <code>mel.Id.ToString()</code>,如果 <c>XMLClassData</c> 的 <c>SerializeId</c> 屬性與這個 </w:t></w:r> </w:rPr><w:r><w:rPr><w:rStyle w:val="ParameterReference" /><w:t><w:r><w:t> mel</w:t></w:r> DomainClass 是其他 case 的 <c>(不是預設值) 的 true</c>,配接器作者應該提供唯一的 ID (例如 moniker)

請參閱

StandardModelingAdapter 類別
Microsoft.VisualStudio.Modeling.Integration 命名空間

回到頁首