次の方法で共有


ConnectionsZone.ConfigureVerb プロパティ

定義

接続ユーザー インターフェイス (UI) の構成ビューを開くために使用する WebPartVerb オブジェクトへの参照を取得します。

public:
 virtual property System::Web::UI::WebControls::WebParts::WebPartVerb ^ ConfigureVerb { System::Web::UI::WebControls::WebParts::WebPartVerb ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public virtual System.Web.UI.WebControls.WebParts.WebPartVerb ConfigureVerb { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.ConfigureVerb : System.Web.UI.WebControls.WebParts.WebPartVerb
Public Overridable ReadOnly Property ConfigureVerb As WebPartVerb

プロパティ値

接続 UI の接続の構成セクションを開くために使用する WebPartVerb

属性

次のコード例では、 コントロールで プロパティを使用する ConfigureVerb 方法を ConnectionsZone 示します。 この例には、 プロパティの使用を示す Web ページのコードのみが含まれています。この例を実行するために必要な他の 2 つのコード ファイルについては、クラスの概要の「例」セクションを ConnectionsZone 参照してください。 このコード例には、次の 4 つの部分があります。

  • Web ページで表示モードを切り替えるユーザー コントロール。 クラスの概要からこのコードを ConnectionsZone 取得します。

  • ZIP コード インターフェイスのコードと、プロバイダーと接続のコンシューマーとして機能する 2 つの WebPart コントロールを含むソース ファイル。 クラスの概要からこのコードを ConnectionsZone 取得します。

  • すべてのコントロールをホストし、要素を <asp:connectionszone> 宣言し、宣言的およびプログラム的に プロパティを使用する方法を示す Web ページ。

  • ブラウザーでのこの例の動作の説明。

Web ページは 要素を <asp:connectionszone> 宣言し、 要素内で 要素を宣言し、 属性を <configureverb> 使用してプロパティを設定します。 また、 メソッドでは Page_PreRender 、 コントロールの configure 動詞にプロパティを ConnectionsZone 設定します。

<%@ Page Language="C#" %>
<%@ register tagprefix="uc1" 
    tagname="DisplayModeMenuCS"
    src="~/displaymodemenucs.ascx" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.CS.Controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  protected void Page_PreRender(object sender, EventArgs e)
  {
     // Set properties on verbs.
     connectionsZone1.CancelVerb.Description = 
       "Terminates the connection process";
     connectionsZone1.CloseVerb.Description = 
       "Closes the connections UI";
     connectionsZone1.ConfigureVerb.Description =
       "Configure the transformer for the connection";
     connectionsZone1.ConnectVerb.Description =
       "Connect two WebPart controls";
     connectionsZone1.DisconnectVerb.Description =
       "End the connection between two controls";
    
     // Set properties for UI text strings.
     connectionsZone1.ConfigureConnectionTitle = 
       "Configure";
     connectionsZone1.ConnectToConsumerInstructionText = 
       "Choose a consumer connection point";
     connectionsZone1.ConnectToConsumerText = 
       "Select a consumer for the provider to connect with";
     connectionsZone1.ConnectToConsumerTitle = 
       "Send data to this consumer";
     connectionsZone1.ConnectToProviderInstructionText =
       "Choose a provider connection point";
     connectionsZone1.ConnectToProviderText =
       "Select a provider for the consumer to connect with";
     connectionsZone1.ConnectToProviderTitle =
       "Get data from this provider";
     connectionsZone1.ConsumersInstructionText = 
       "WebPart controls that receive data from providers";
     connectionsZone1.ConsumersTitle = "Consumer Controls";
     connectionsZone1.GetFromText = "Receive from";
     connectionsZone1.GetText = "Retrieve";
     connectionsZone1.HeaderText = 
      "Create and Manage Connections";
     connectionsZone1.InstructionText = 
      "Manage connections for the selected WebPart control";
     connectionsZone1.InstructionTitle = 
       "Manage connections for consumers or providers";
     connectionsZone1.NoExistingConnectionInstructionText = 
       "No connections exist. Click the above link to create "
       + "a connection.";
     connectionsZone1.NoExistingConnectionTitle = 
       "No current connections";
     connectionsZone1.ProvidersInstructionText =
       "WebPart controls that send data to consumers";
     connectionsZone1.ProvidersTitle = "Provider controls";
     
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Connection Zone Sample</title>
</head>
<body>
  <form id="form1" runat="server">
  <asp:webpartmanager runat="server" id="mgr">
    <staticconnections>
      <asp:webpartconnection id="connection1" 
        consumerconnectionpointid="ZipCodeConsumer"
        consumerid="zipConsumer"
        providerconnectionpointid="ZipCodeProvider" 
        providerid="zipProvider" />
    </staticconnections>
  </asp:webpartmanager>
  <uc1:displaymodemenucs id="menu1" runat="server" />
  <div>
  <asp:webpartzone id="WebPartZone1" runat="server">
    <zonetemplate>
      <aspsample:zipcodewebpart id="zipProvider" runat="server" 
        Title="Zip Code Provider"  />
      <aspsample:weatherwebpart id="zipConsumer" runat="server" 
        Title="Zip Code Consumer" />
    </zonetemplate>
  </asp:webpartzone>
  <asp:connectionszone id="connectionsZone1" runat="server" >
    <cancelverb text="Terminate" />
    <closeverb text="Close Zone" />
    <configureverb text="Configure" />
    <connectverb text="Connect Controls" />
    <disconnectverb text="End Connection" />
  </asp:connectionszone>
  </div>
  </form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ register tagprefix="uc1" 
    tagname="DisplayModeMenuVB"
    src="~/displaymodemenuvb.ascx" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.VB.Controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Protected Sub Page_PreRender(ByVal sender As Object, _
    ByVal e As System.EventArgs)
    
    ' Set properties for verbs.
    connectionsZone1.CancelVerb.Description = _
      "Terminates the connection process"
    connectionsZone1.CloseVerb.Description = _
      "Closes the connections UI"
    connectionsZone1.ConfigureVerb.Description = _
      "Configure the transformer for the connection"
    connectionsZone1.ConnectVerb.Description = _
      "Connect two WebPart controls"
    connectionsZone1.DisconnectVerb.Description = _
      "End the connection between two controls"
    
    ' Set properties for UI text strings.
    connectionsZone1.ConfigureConnectionTitle = _
      "Configure a new connection"
    connectionsZone1.ConnectToConsumerInstructionText = _
      "Choose a consumer connection point"
    connectionsZone1.ConnectToConsumerText = _
      "Select a consumer for the provider to connect with"
    connectionsZone1.ConnectToConsumerTitle = _
      "Send data to this consumer"
    connectionsZone1.ConnectToProviderInstructionText = _
      "Choose a provider connection point"
    connectionsZone1.ConnectToProviderText = _
      "Select a provider for the consumer to connect with"
    connectionsZone1.ConnectToProviderTitle = _
      "Get data from this provider"
    connectionsZone1.ConsumersInstructionText = _
      "WebPart controls that receive data from providers"
    connectionsZone1.ConsumersTitle = "Consumer Controls"
    connectionsZone1.GetFromText = "Receive from"
    connectionsZone1.GetText = "Retrieve"
    connectionsZone1.HeaderText = _
      "Create and Manage Connections"
    connectionsZone1.InstructionText = _
      "Manage connections for the selected WebPart control"
    connectionsZone1.InstructionTitle = _
      "Manage connections for consumers or providers"
    connectionsZone1.NoExistingConnectionInstructionText = _
      "No connections exist. Click the above link to create " _
      & "a connection."
    connectionsZone1.NoExistingConnectionTitle = _
      "No current connections"
    connectionsZone1.ProvidersInstructionText = _
      "WebPart controls that send data to consumers"
    connectionsZone1.ProvidersTitle = "Provider controls"

  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Connection Zone Sample</title>
</head>
<body>
  <form id="form1" runat="server">
  <asp:webpartmanager runat="server" id="mgr">
    <staticconnections>
      <asp:webpartconnection id="connection1" 
        consumerconnectionpointid="ZipCodeConsumer"
        consumerid="zipConsumer"
        providerconnectionpointid="ZipCodeProvider" 
        providerid="zipProvider" />
    </staticconnections>
  </asp:webpartmanager>
  <uc1:displaymodemenuvb id="menu1" runat="server" />
  <div>
  <asp:webpartzone id="WebPartZone1" runat="server">
    <zonetemplate>
      <aspsample:zipcodewebpart id="zipProvider" runat="server" 
        Title="Zip Code Provider" />
      <aspsample:weatherwebpart id="zipConsumer" runat="server" 
        Title="Zip Code Consumer" />
    </zonetemplate>
  </asp:webpartzone>
  <asp:connectionszone id="connectionsZone1" runat="server" >
    <cancelverb text="Terminate" />
    <closeverb text="Close Zone" />
    <configureverb text="Configure" />
    <connectverb text="Connect Controls" />
    <disconnectverb text="End Connection" />
  </asp:connectionszone>
  </div>
  </form>
</body>
</html>

ブラウザーでページを読み込みます。 [表示モード] コントロールを使用して、接続モードに切り替えます。 ZIP コード プロバイダー コントロールの動詞メニュー矢印をクリックし、connect 動詞をクリックします。 既に接続されているコントロールを切断するための [ 接続の終了 ] ボタンと、無効になっている [構成 ] ボタンがあることに注意してください。 コード例で構成ウィザードを含むトランスフォーマーを使用している場合は、[ 構成 ] ボタンが有効になり、ユーザーはそれをクリックして接続を構成できます。 接続 UI の [構成 ] ボタンの上にマウス ポインターを置くと、ツールヒントにカスタム説明テキストが表示されます。

注釈

接続が既に存在し、ユーザーが接続 UI を開いている場合は、接続 UI の [接続の管理] セクションに構成動詞が表示されます。 UI には、接続を終了するための [ 接続の終了 ] ボタンと、接続を 構成するための [構成 ] ボタン (構成動詞を表す) が表示されます。 ユーザーが [ 構成 ] ボタンをクリックすると、UI の [接続の構成] セクションが表示され、ユーザーが接続を構成できるようになります。 接続を構成するこのオプション (したがって、[ 構成 ] ボタン) は、接続でトランスフォーマーが使用されている場合にのみ有効になり、トランスフォーマーには、ユーザーが構成できるようにする構成ウィザード コントロール (Wizard) が含まれています。 詳細については、 クラスを WebPartTransformer 参照してください。

プロパティを ConfigureVerb 使用して、UI 内の対応する WebPartVerb オブジェクトへの参照を取得します。 プロパティ自体は読み取り専用ですが、動詞への参照を取得した後は、必要に応じてプロパティ値を変更できます。

要素のタグ内で 要素を宣言 <configureverb> することで、構成動詞のプロパティ値を <asp:connectionszone> 宣言によって設定できます。 動詞のプロパティは、 という形式 Property-Subpropertyで宣言的に設定できます。ここで Subproperty 、 は オブジェクトの WebPartVerb プロパティです (例: ConfigureVerb-Text)。 フォーム Property.Subproperty でプログラムでプロパティを設定することもできます (例: ConfigureVerb.Text)。

適用対象

こちらもご覧ください