本文整理汇总了C#中ResourcePath.IsParentOf方法的典型用法代码示例。如果您正苦于以下问题:C# ResourcePath.IsParentOf方法的具体用法?C# ResourcePath.IsParentOf怎么用?C# ResourcePath.IsParentOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourcePath
的用法示例。
在下文中一共展示了ResourcePath.IsParentOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScheduleRefresh
public void ScheduleRefresh(ResourcePath path, IEnumerable<string> mediaCategories, bool includeSubDirectories)
{
ICollection<ImportJob> importJobs;
lock (_syncObj)
importJobs = new List<ImportJob>(_importJobs);
ICollection<ImportJob> removeImportJobs = new List<ImportJob>();
foreach (ImportJob checkJob in importJobs)
{
if (checkJob.BasePath.IsSameOrParentOf(path))
{
// The new job is included in an already existing job - re-schedule existing job
path = checkJob.BasePath;
checkJob.Cancel();
removeImportJobs.Add(checkJob);
}
if (path.IsParentOf(checkJob.BasePath))
{ // The new job will include the old job
checkJob.Cancel();
removeImportJobs.Add(checkJob);
}
}
lock (_syncObj)
foreach (ImportJob removeJob in removeImportJobs)
_importJobs.Remove(removeJob);
ICollection<Guid> metadataExtractorIds = GetMetadataExtractorIdsForMediaCategories(mediaCategories);
ImportJob job = new ImportJob(ImportJobType.Refresh, path, metadataExtractorIds, includeSubDirectories);
EnqueueImportJob(job);
ImporterWorkerMessaging.SendImportMessage(ImporterWorkerMessaging.MessageType.ImportScheduled, path, ImportJobType.Refresh);
}