ControlDesigner.UpdateDesignTimeHtml 메서드

정의

GetDesignTimeHtml 메서드를 호출하여 연결된 웹 서버 컨트롤에 대한 디자인 타임 HTML 태그를 새로 고칩니다.

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

예제

다음 코드 예제에서는 컨트롤 디자이너의 이벤트에 응답하여 Click 다중 지역 컨트롤의 영역 간 포커스를 변경하고 메서드를 사용하여 UpdateDesignTimeHtml 디자인 호스트에서 컨트롤의 모양을 업데이트하는 방법을 보여 줍니다.

이 코드 예제는 클래스에 대한 더 큰 예제의 EditableDesignerRegion 일부입니다.

// 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

설명

메서드는 UpdateDesignTimeHtml 디자인 호스트에서 호출되어 컨트롤이 수정된 시기와 같이 디자인 타임에 연결된 웹 서버 컨트롤의 표시를 업데이트합니다. 또한 컨트롤 디자이너는 컨트롤의 UpdateDesignTimeHtml 값을 수정한 후 메서드를 호출하여 컨트롤의 표시를 업데이트할 수 있습니다.

참고

이벤트를 호출하거나 개체를 ComponentChangedPropertyDescriptor 사용하여 속성을 설정하는 경우 인터페이스는 IComponentChangeService 메서드를 UpdateDesignTimeHtml 호출합니다.

적용 대상

추가 정보