本文整理匯總了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());
}