AnnotationService.Disable Metoda

Definicja

Wyłącza przetwarzanie adnotacji i ukrywa wszystkie widoczne adnotacje.Disables annotations processing and hides all visible annotations.

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

Przykłady

Poniższy przykład pokazuje, jak używać Disable metody po zatrzymaniu AnnotationService .The following example shows how to use the Disable method when you stop the 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

Uwagi

Gdy Disable jest wywoływana, wszystkie adnotacje stają się ukryte.When Disable is called all annotations become hidden.

Dotyczy

Zobacz też