StaticSiteMapProvider.Clear 메서드

정의

자식 및 부모 사이트 맵 노드 컬렉션에서 해당 상태의 일부로 추적하는 모든 요소를 제거합니다 StaticSiteMapProvider .

protected:
 virtual void Clear();
protected virtual void Clear();
abstract member Clear : unit -> unit
override this.Clear : unit -> unit
Protected Overridable Sub Clear ()

예제

다음 코드 예제에서는 클래스에서 유지 관리 되는 상태의 추가 정리를 수행 하는 메서드를 재정 Clear 의 하는 방법을 보여 줍니다.

이 코드 예제는 클래스에 제공된 더 큰 예제의 StaticSiteMapProvider 일부입니다.

   // Clean up any collections or other state that an instance of this may hold.
   virtual void Clear() override
   {
      System::Threading::Monitor::Enter( this );
      try
      {
         rootNode = nullptr;
         StaticSiteMapProvider::Clear();
      }
      finally
      {
         System::Threading::Monitor::Exit( this );
      }

   }


public:
// Clean up any collections or other state that an instance of this may hold.
protected override void Clear() {
    lock (this) {
        rootNode = null;
        base.Clear();
    }
}
' SiteMapProvider and StaticSiteMapProvider methods that this derived class must override.
'
' Clean up any collections or other state that an instance of this may hold.
Protected Overrides Sub Clear()
    SyncLock Me
        aRootNode = Nothing
        MyBase.Clear()
    End SyncLock
End Sub

설명

클래스에서 StaticSiteMapProvider 파생된 클래스는 파생 클래스가 유지 관리하는 상태에 따라 메서드를 재정 Clear 의하여 추가 정리를 수행할 수 있습니다.

메서드는 Clear 메서드 중에 Initialize 초기화된 상태를 다시 설정하지 않으며 메서드 중에 BuildSiteMap 초기화된 상태만 다시 설정합니다.

적용 대상

추가 정보