AnnotationService.Disable 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
禁用批注处理并隐藏所有可见批注。
public:
void Disable();
public void Disable ();
member this.Disable : unit -> unit
Public Sub Disable ()
示例
下面的示例演示如何在停止AnnotationService该方法时使用Disable该方法。
// ------------------------ 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 会隐藏。