ControlDesigner.UpdateDesignTimeHtml Método

Definição

Atualiza a marcação HTML de tempo de design do controle de servidor Web associado ao chamar o método GetDesignTimeHtml.Refreshes the design-time HTML markup for the associated Web server control by calling the GetDesignTimeHtml method.

public:
 virtual void UpdateDesignTimeHtml();
public virtual void UpdateDesignTimeHtml ();
abstract member UpdateDesignTimeHtml : unit -> unit
override this.UpdateDesignTimeHtml : unit -> unit
Public Overridable Sub UpdateDesignTimeHtml ()

Exemplos

O exemplo de código a seguir demonstra como responder a um Click evento em um designer de controle para alterar o foco entre regiões em um controle de várias regiões e usar o UpdateDesignTimeHtml método para atualizar a aparência do controle no host de design.The following code example demonstrates how to respond to a Click event in a control designer to change the focus between regions in a multi-region control and use the UpdateDesignTimeHtml method to update the appearance of the control in the design host.

Este exemplo de código faz parte de um exemplo maior para a EditableDesignerRegion classe.This code example is part of a larger example for the EditableDesignerRegion class.

// Handler for the Click event, which provides the region in the arguments.
protected override void OnClick(DesignerRegionMouseEventArgs e)
{
    if (e.Region == null)
        return;

    // If the clicked region is not a header, return
    if (e.Region.Name.IndexOf("Header") != 0)
        return;

    // Switch the current view if required
    if (e.Region.Name.Substring(6, 1) != myControl.CurrentView.ToString())
    {
        myControl.CurrentView = int.Parse(e.Region.Name.Substring(6, 1));
        base.UpdateDesignTimeHtml();
    }
}
' Handler for the Click event, which provides the region in the arguments.
Protected Overrides Sub OnClick(ByVal e As DesignerRegionMouseEventArgs)
    If IsNothing(e.Region) Then
        Return
    End If

    ' If the clicked region is not a header, return
    If e.Region.Name.IndexOf("Header") <> 0 Then
        Return
    End If

    ' Switch the current view if required
    If e.Region.Name.Substring(6, 1) <> myControl.CurrentView.ToString() Then
        myControl.CurrentView = Integer.Parse(e.Region.Name.Substring(6, 1))
        MyBase.UpdateDesignTimeHtml()
    End If
End Sub

Comentários

O UpdateDesignTimeHtml método é chamado pelo host de design para atualizar a exibição do controle de servidor Web associado em tempo de design, como quando o controle foi modificado.The UpdateDesignTimeHtml method is called by the design host to update the display of the associated Web server control at design time, such as when the control has been modified. Além disso, um designer de controle pode chamar o UpdateDesignTimeHtml método após modificar os valores do controle para atualizar a exibição do controle.Also, a control designer can call the UpdateDesignTimeHtml method after modifying values of the control to update the display of the control.

Observação

Se você estiver chamando o ComponentChanged evento ou usando o PropertyDescriptor objeto para definir propriedades, a IComponentChangeService interface chamará o UpdateDesignTimeHtml método para você.If you are calling the ComponentChanged event, or using the PropertyDescriptor object to set properties, the IComponentChangeService interface calls the UpdateDesignTimeHtml method for you.

Aplica-se a

Confira também