CacheDependency.DependencyDispose メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CacheDependency.DependencyDispose メソッドの意味・解説 

CacheDependency.DependencyDispose メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

CacheDependency クラス、および CacheDependency から派生したクラス使用したリソース解放します。

名前空間: System.Web.Caching
アセンブリ: System.Web (system.web.dll 内)
構文構文

Protected Overridable Sub
 DependencyDispose
Me.DependencyDispose
protected virtual void DependencyDispose ()
protected:
virtual void DependencyDispose ()
protected void DependencyDispose ()
protected function DependencyDispose ()
解説解説

CacheDependency クラスから派生したクラスは、派生クラス使用したリソースクリーンアップするために、このメソッド実装する必要があります

使用例使用例

CacheDependency クラスから継承されDependencyDispose メソッドオーバーライドするクラスコード例次に示します。このメソッドは、呼び出されると、Disposed という名前のブール値のカスタム プロパティtrue設定します

' Declare the class.
Public Class CustomCacheDependency 
   Inherits CacheDependency

     ' Constructor with no arguments 
     ' provided by CacheDependency class.
     Public Sub New()
     End Sub ' New
   
     ' Declare a Boolean field named disposedValue.
     ' This will be used by Disposed property.
     Private disposedValue As Boolean
                
     
     ' Create accessors for the Disposed property.
     Public Property Disposed As
 Boolean
       Get
           Return disposedValue
       End Get
       Set (ByVal value As
 Boolean)
           disposedValue = value
       End Set
     End Property
     
     ' Create a public method that sets the latest
     ' changed time of the CustomCacheDependency
     ' and notifies the underlying CacheDependency that the 
     ' dependency has changed, even though the HasChanged
     ' property is false.
     Public Sub ResetDependency()
        If Me.HasChanged = False
              
           SetUtcLastModified(DateTime.MinValue)
           NotifyDependencyChanged(Me, EventArgs.Empty)
        End If
     End Sub
     
     ' Overrides the DependencyDispose method to set the
     ' Disposed proerty to true. This method automatically
     ' notifies the underlying CacheDependency object to 
     ' release any resources associated with this class. 
     Protected Overrides Sub
 DependencyDispose()
        Disposed = True
     End Sub
     
     
 End Class
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CacheDependency クラス
CacheDependency メンバ
System.Web.Caching 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

CacheDependency.DependencyDispose メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CacheDependency.DependencyDispose メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS