ConnectionsZone.CloseVerb Propriedade
Definição
Obtém uma referência a um objeto WebPartVerb que permite aos usuários finais fechar a IU (interface do usuário) de conexão criada pelo controle ConnectionsZone.Gets a reference to a WebPartVerb object that enables end users to close the connection user interface (UI) created by the ConnectionsZone control.
public:
virtual property System::Web::UI::WebControls::WebParts::WebPartVerb ^ CloseVerb { System::Web::UI::WebControls::WebParts::WebPartVerb ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public virtual System.Web.UI.WebControls.WebParts.WebPartVerb CloseVerb { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.CloseVerb : System.Web.UI.WebControls.WebParts.WebPartVerb
Public Overridable ReadOnly Property CloseVerb As WebPartVerb
Valor da propriedade
Um WebPartVerb que permite que um usuário final feche a interface do usuário da conexão.A WebPartVerb that allows an end user to close the connection UI.
- Atributos
Exemplos
O exemplo de código a seguir demonstra o uso da CloseVerb propriedade com um ConnectionsZone controle.The following code example demonstrates the use of the CloseVerb property with a ConnectionsZone control. O exemplo contém apenas o código para a página da Web que demonstra o uso da propriedade; para os outros dois arquivos de código necessários para executar o exemplo, consulte a seção de exemplo da ConnectionsZone classe visão geral.The example contains only the code for the Web page that demonstrates use of the property; for the other two code files needed to run the example, see the Example section of the ConnectionsZone class overview. O exemplo de código tem quatro partes:The code example has four parts:
Um controle de usuário que permite que você alterne modos de exibição na página da Web.A user control that enables you to switch display modes on the Web page. Obtenha esse código na ConnectionsZone visão geral da classe.Obtain this code from the ConnectionsZone class overview.
Um arquivo de origem que contém o código para uma interface de CEP e dois WebPart controles que atuam como o provedor e o consumidor para uma conexão.A source file that contains the code for a ZIP Code interface, and two WebPart controls acting as the provider and the consumer for a connection. Obtenha esse código na ConnectionsZone visão geral da classe.Obtain this code from the ConnectionsZone class overview.
Uma página da Web que hospeda todos os controles, declara um
<asp:connectionszone>elemento e mostra como usar a propriedade de forma declarativa e programaticamente.A Web page that hosts all the controls, declares an<asp:connectionszone>element, and shows how to use the property declaratively and programmatically.Uma explicação de como o exemplo funciona em um navegador.An explanation of how the example works in a browser.
A página da Web declara um <asp:connectionszone> elemento e, dentro do elemento, ele declara um <closeverb> elemento e define uma propriedade usando atributos.The Web page declares an <asp:connectionszone> element, and within the element, it declares a <closeverb> element and sets a property using attributes. Além disso, no Page_PreRender método, o código define uma propriedade no verbo Close para o ConnectionsZone controle.Also, in the Page_PreRender method, the code sets a property on the close verb for the ConnectionsZone control.
<%@ 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>
Carregue a página em um navegador.Load the page in a browser. Alterne para o modo de conexão usando o controle modo de exibição .Switch to connect mode, using the Display Mode control. Clique na seta de menu de verbos no controle do provedor de CEP e clique no verbo conectar.Click the verbs menu arrow on the ZIP Code Provider control, and click the connect verb. Clique no botão encerrar conexão para desconectar os controles que já estão conectados devido à conexão declarativa na página.Click the End Connection button to disconnect the controls that are already connected due to the declarative connection on the page. Clique no botão selecionar um consumidor para o provedor para se conectar ao hiperlink e observe o efeito de definir as várias propriedades.Click the Select a consumer for the provider to connect with hyperlink, and notice the effect of setting the various properties. Se você posicionar o ponteiro do mouse sobre o botão fechar zona na parte inferior da interface do usuário da conexão, o texto da descrição personalizada será exibido em uma dica de ferramenta.If you position your mouse pointer over the Close Zone button at the bottom of the connection UI, the custom description text appears in a ToolTip. Observe que o verbo de fechamento de cabeçalho na parte superior da zona de conexões é representado por um hiperlink, e suas atribuições de propriedade no verbo Close não têm efeito sobre o verbo close do cabeçalho.Notice that the header close verb at the top of the connections zone is represented by a hyperlink, and your property assignments on the close verb have no effect on the header close verb.
Comentários
O verbo Close, conforme usado com um ConnectionsZone controle, é um verbo de nível de zona que aparece na parte inferior (o rodapé) da interface do usuário da conexão.The close verb, as used with a ConnectionsZone control, is a zone-level verb that appears at the bottom (the footer) of the connection UI. Quando os usuários clicam no verbo fechar, ele cancela o processo de conexão e fecha a interface do usuário da conexão, mas deixa a página no modo de exibição conectar.When users click the close verb, it cancels the connection process and closes the connection UI, but leaves the page in connect display mode. Neste ponto, o usuário pode retornar a página para o modo de procura ou clicar no verbo conectar em outro controle de servidor para reabrir a interface do usuário da conexão.At this point, the user can either return the page to browse mode or click the connect verb on another server control to reopen the connection UI.
O verbo Close deve ser diferenciado do verbo de fechamento do cabeçalho (para obter detalhes, consulte a HeaderCloseVerb Propriedade).The close verb should be distinguished from the header close verb (for details, see the HeaderCloseVerb property). Ambos os verbos executam a ação idêntica de fechar a interface do usuário de conexão, mas o verbo de fechamento do cabeçalho aparece na parte superior da interface do usuário e é representado por um hiperlink por padrão, enquanto o verbo de fechamento aparece na parte inferior da interface do usuário e é representado por um botão por padrão.Both verbs perform the identical action of closing the connection UI, but the header close verb appears at the top of the UI and is represented by a hyperlink by default, whereas the close verb appears at the bottom of the UI, and is represented by a button by default.
Use a CloseVerb propriedade para obter uma referência ao objeto correspondente WebPartVerb na interface do usuário.Use the CloseVerb property to get a reference to the corresponding WebPartVerb object in the UI. Embora a própria propriedade seja somente leitura, depois de ter uma referência ao verbo, você pode alterar seus valores de propriedade conforme necessário.Although the property itself is read-only, after you have a reference to the verb, you can change its property values as needed.
Você pode definir os valores de Propriedade do verbo Close declarativamente, declarando o <closeverb> elemento dentro das marcas de um <asp:connectionszone> elemento.You can set the property values of the close verb declaratively, by declaring the <closeverb> element within the tags of an <asp:connectionszone> element. As propriedades do verbo podem ser definidas declarativamente no formulário Property-Subproperty , em que Subproperty é uma propriedade do WebPartVerb objeto (por exemplo, CloseVerb-Text ).The properties of the verb can be set declaratively in the form Property-Subproperty, where Subproperty is a property of the WebPartVerb object (for example, CloseVerb-Text). Você também pode definir as propriedades programaticamente no formulário Property.Subproperty (por exemplo, CloseVerb.Text ).You can also set the properties programmatically in the form Property.Subproperty (for example, CloseVerb.Text).