次の方法で共有


AnnotationService.Disable メソッド

定義

注釈処理を無効にし、表示可能な注釈をすべて非表示にします。

public:
 void Disable();
public void Disable ();
member this.Disable : unit -> unit
Public Sub Disable ()

次の例は、 を停止するときに メソッドを Disable 使用する方法を AnnotationService示しています。

// ------------------------ StopAnnotations ---------------------------
/// <summary>
///   Disables annotation processing and hides all annotations.</summary>
private void StopAnnotations()
{
    // If the AnnotationStore is active, flush and close it.
    if (_annotStore != null)
    {
        _annotStore.Flush();
        _annotStream.Flush();
        _annotStream.Close();
        _annotStore = null;
    }

    // If the AnnotationService is active, shut it down.
    if (_annotService != null)
    {
        if (_annotService.IsEnabled)
        {
            _annotService.Disable();  // Disable the AnnotationService.
            _annotService = null;
        }
    }
}// end:StopAnnotations()
' ------------------------ StopAnnotations ---------------------------
''' <summary>
'''   Disables annotation processing and hides all annotations.</summary>
Private Sub StopAnnotations()
    ' If the AnnotationStore is active, flush and close it.
    If _annotStore IsNot Nothing Then
        _annotStore.Flush()
        _annotStream.Flush()
        _annotStream.Close()
        _annotStore = Nothing
    End If

    ' If the AnnotationService is active, shut it down.
    If _annotService IsNot Nothing Then
        If _annotService.IsEnabled Then
            _annotService.Disable() ' Disable the AnnotationService.
            _annotService = Nothing
        End If
    End If
End Sub

注釈

が呼び出されると Disable 、すべての注釈が非表示になります。

適用対象

こちらもご覧ください