本文整理汇总了C#中System.IO.DirectoryInfo.Max方法的典型用法代码示例。如果您正苦于以下问题:C# DirectoryInfo.Max方法的具体用法?C# DirectoryInfo.Max怎么用?C# DirectoryInfo.Max使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.DirectoryInfo
的用法示例。
在下文中一共展示了DirectoryInfo.Max方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompareDate
protected override DateTime CompareDate(BaseItem item)
{
var id = item.GetProviderId(MetadataProviders.Tvdb);
if (!string.IsNullOrEmpty(id))
{
// Process images
var path = GetSeriesDataPath(ConfigurationManager.ApplicationPaths, id);
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
.Select(i => i.LastWriteTimeUtc)
.ToArray();
if (files.Length > 0)
{
return files.Max();
}
}
return base.CompareDate(item);
}
示例2: NeedsRefreshBasedOnCompareDate
protected override bool NeedsRefreshBasedOnCompareDate(BaseItem item, BaseProviderInfo providerInfo)
{
var seriesId = item.GetProviderId(MetadataProviders.Tvdb);
if (!string.IsNullOrEmpty(seriesId))
{
// Process images
var path = GetSeriesDataPath(ConfigurationManager.ApplicationPaths, seriesId);
try
{
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
.Select(i => _fileSystem.GetLastWriteTimeUtc(i))
.ToList();
if (files.Count > 0)
{
return files.Max() > providerInfo.LastRefreshed;
}
}
catch (DirectoryNotFoundException)
{
// Don't blow up
return true;
}
}
return base.NeedsRefreshBasedOnCompareDate(item, providerInfo);
}
示例3: CompareDate
protected override DateTime CompareDate(BaseItem item)
{
var musicBrainzId = item.GetProviderId(MetadataProviders.Musicbrainz);
if (!string.IsNullOrEmpty(musicBrainzId))
{
// Process images
var path = GetArtistDataPath(ConfigurationManager.ApplicationPaths, musicBrainzId);
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
.Select(i => i.LastWriteTimeUtc)
.ToList();
if (files.Count > 0)
{
return files.Max();
}
}
return base.CompareDate(item);
}