ControlDesigner.UpdateDesignTimeHtml メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
GetDesignTimeHtml メソッドを呼び出して、関連付けられている Web サーバー コントロールのデザイン時 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 メソッドは、デザイン ホストによって呼び出され、コントロールが変更されたときなど、デザイン時に関連付けられている Web サーバー コントロールの表示を更新します。 また、コントロール デザイナーは、コントロールの値を変更してコントロールの表示を更新した後、 UpdateDesignTimeHtml メソッドを呼び出すことができます。
Note
ComponentChanged イベントを呼び出す場合、または PropertyDescriptor オブジェクトを使用してプロパティを設定する場合、IComponentChangeService インターフェイスはUpdateDesignTimeHtml メソッドを呼び出します。