ConnectionProviderAttribute.DisplayName 屬性

定義

取得提供者連接點的易記名稱。

public:
 virtual property System::String ^ DisplayName { System::String ^ get(); };
public virtual string DisplayName { get; }
member this.DisplayName : string
Public Overridable ReadOnly Property DisplayName As String

屬性值

字串,包含提供者連接點的易記顯示名稱。

範例

下列程式碼範例示範如何使用 DisplayName 屬性,示範如何在提供者控制項的回呼方法上宣告 ConnectionProviderAttribute 中繼資料專案。 請注意,會使用建構函式的最簡單多載; displayName 只提供參數值。 參數的值將會成為 屬性的值 DisplayName 。 如需執行程式碼範例所需的完整程式碼,請參閱 ConnectionProviderAttribute 類別概觀。

[ConnectionProvider("Row")]
public IWebPartRow GetConnectionInterface()
{
    return new RowProviderWebPart();
}
<ConnectionProvider("Row")> _
Public Function GetConnectionInterface() As IWebPartRow
    Return New RowProviderWebPart()

End Function 'GetConnectionInterface

備註

此屬性是提供者連接點的易記名稱。 當您將 displayName 參數 ConnectionProviderAttribute 加入回呼方法上的中繼資料元素時,可以宣告方式設定其值。 它也可以使用受保護的 DisplayNameValue 屬性,以程式設計方式由衍生類別設定。

當您搜尋連接點集合時,應該使用 ID 屬性,因為 ID 屬性必須是唯一的,但 DisplayName 屬性不需要。

DisplayName當控制項位於頁面上時,提供者連接點的 屬性會顯示給使用者 ConnectionsZone ,連接使用者介面 (UI) 已開啟,而且使用者位於允許使用者選取連接點以建立連線的檢視中。

適用於

另請參閱