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

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

VirtualPathProvider.GetCacheDependency メソッド

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

指定した仮想パス基づいてキャッシュ依存関係作成します

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

Public Overridable Function
 GetCacheDependency ( _
    virtualPath As String, _
    virtualPathDependencies As IEnumerable, _
    utcStart As DateTime _
) As CacheDependency
Dim instance As VirtualPathProvider
Dim virtualPath As String
Dim virtualPathDependencies As IEnumerable
Dim utcStart As DateTime
Dim returnValue As CacheDependency

returnValue = instance.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart)
public virtual CacheDependency GetCacheDependency (
    string virtualPath,
    IEnumerable virtualPathDependencies,
    DateTime utcStart
)
public:
virtual CacheDependency^ GetCacheDependency (
    String^ virtualPath, 
    IEnumerable^ virtualPathDependencies, 
    DateTime utcStart
)
public CacheDependency GetCacheDependency (
    String virtualPath, 
    IEnumerable virtualPathDependencies, 
    DateTime utcStart
)
public function GetCacheDependency (
    virtualPath : String, 
    virtualPathDependencies : IEnumerable, 
    utcStart : DateTime
) : CacheDependency

パラメータ

virtualPath

プライマリリソースへのパス

virtualPathDependencies

プライマリ仮想リソース必要な他のリソースへのパス配列

utcStart

仮想リソース読み取られUTC 時刻

戻り値
指定した仮想リソースの CacheDependency オブジェクト

解説解説

GetCacheDependency メソッド既定実装では null 参照 (Visual Basic では Nothing) を返します後で使用できるように仮想リソースキャッシュするには、GetCacheDependency メソッドまたは GetFileHash メソッドオーバーライドする必要があります

使用例使用例

VirtualPathProvider カスタム クラスGetCacheDependency メソッド実装例次のコード例示します例の実行必要なコード全体については、VirtualPathProvider クラス概要トピックで「例」を参照してください

Public Overrides Function
 GetCacheDependency(ByVal virtualPath As String,
 ByVal virtualPathDependencies As IEnumerable, ByVal utcStart As Date)
 As CacheDependency
  If (IsPathVirtual(virtualPath)) Then

    Dim fullPathDependencies As System.Collections.Specialized.StringCollection
    fullPathDependencies = Nothing

    ' Get the full path to all dependencies.
    For Each virtualDependency As
 String In virtualPathDependencies
      If fullPathDependencies Is Nothing
 Then
        fullPathDependencies = New System.Collections.Specialized.StringCollection
      End If

      fullPathDependencies.Add(virtualDependency)
    Next

    If fullPathDependencies Is Nothing
 Then
      Return Nothing
    End If

    Dim fullPathDependenciesArray As String()
    fullPathDependencies.CopyTo(fullPathDependenciesArray, 0)

    Return New CacheDependency(fullPathDependenciesArray,
 utcStart)
  Else
    Return Previous.GetCacheDependency(virtualPath, virtualPathDependencies,
 utcStart)
  End If
End Function
public override CacheDependency GetCacheDependency(
  string virtualPath, 
  System.Collections.IEnumerable virtualPathDependencies, 
  DateTime utcStart)
{
  if (IsPathVirtual(virtualPath))
  {
    System.Collections.Specialized.StringCollection fullPathDependencies = null;

    // Get the full path to all dependencies.
    foreach (string virtualDependency in
 virtualPathDependencies)
    {
      if (fullPathDependencies == null)
        fullPathDependencies = new System.Collections.Specialized.StringCollection();

      fullPathDependencies.Add(virtualDependency);
    }
    if (fullPathDependencies == null)
      return null;

    // Copy the list of full-path dependencies into an array.
    string[] fullPathDependenciesArray = new
 string[fullPathDependencies.Count];
    fullPathDependencies.CopyTo(fullPathDependenciesArray, 0);
    // Copy the virtual path into an array.
    string[] virtualPathArray = new string[1];
    virtualPathArray[0] = virtualPath;

    return new CacheDependency(virtualPathArray,
 fullPathDependenciesArray, utcStart);
  }
  else
    return Previous.GetCacheDependency(virtualPath, virtualPathDependencies,
 utcStart);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
VirtualPathProvider クラス
VirtualPathProvider メンバ
System.Web.Hosting 名前空間



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS