本文整理汇总了C#中System.IO.FileSystemInfo.GetParentDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystemInfo.GetParentDirectory方法的具体用法?C# FileSystemInfo.GetParentDirectory怎么用?C# FileSystemInfo.GetParentDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.FileSystemInfo
的用法示例。
在下文中一共展示了FileSystemInfo.GetParentDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateRenderingJobs
private IEnumerable<IRenderingJob> CreateRenderingJobs(FileSystemInfo inputPath,
IBatchRenderingOptions inputOutputInfo,
RenderingMode? mode)
{
IEnumerable<IRenderingJob> output;
if(inputPath != null && (inputPath is FileInfo))
{
output = new [] { CreateRenderingJob((FileInfo) inputPath, mode, inputPath.GetParentDirectory()) };
}
else if(inputPath != null && (inputPath is DirectoryInfo))
{
var dir = (DirectoryInfo) inputPath;
output = (from file in dir.GetFiles(inputOutputInfo.InputSearchPattern, SearchOption.AllDirectories)
where !inputOutputInfo.IgnoredPaths.Any(x => file.IsChildOf(x))
select CreateRenderingJob(file, mode, dir));
}
else
{
output = new IRenderingJob[0];
}
return output;
}
示例2: ContainsDirectly
/// <summary>
/// Determines if the directory directly contains the other directory or file.
/// </summary>
public static bool ContainsDirectly(this DirectoryInfo dir, FileSystemInfo other)
{
if (dir == null) throw new ArgumentNullException("dir");
if (other == null) throw new ArgumentNullException("other");
return dir.AreSame(other.GetParentDirectory());
}