本文整理匯總了C#中System.IO.FileSystemInfo.IsDirectory方法的典型用法代碼示例。如果您正苦於以下問題:C# FileSystemInfo.IsDirectory方法的具體用法?C# FileSystemInfo.IsDirectory怎麽用?C# FileSystemInfo.IsDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IO.FileSystemInfo
的用法示例。
在下文中一共展示了FileSystemInfo.IsDirectory方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CheckConflictsWithFile
private void CheckConflictsWithFile(FileSystemInfo file)
{
if (file.IsDirectory())
{
List<string> childFiles = ListFiles(file);
Conflicts.AddRange(childFiles);
}
else
{
FileSystemInfo parent = Directory.GetParent(file.FullName);
if (parent == null) return;
while (!parent.Equals(_root))
{
if (parent.IsDirectory())
{
break;
}
if (parent.IsFile())
{
Conflicts.Add(Repository.StripWorkDir(_root, parent));
break;
}
parent = Directory.GetParent(parent.FullName);
if (parent == null) return;
}
}
}
示例2: CreateFrom
public static FileSystemSearchResult CreateFrom(IResultProvider provider, FileSystemInfo fileSystemInfo)
{
if (fileSystemInfo.IsDirectory())
return new DirectorySearchResult(provider, (DirectoryInfo)fileSystemInfo);
if (fileSystemInfo.Extension == ".lnk")
return new ShortcutSearchResult(provider, (FileInfo)fileSystemInfo);
return new FileSearchResult(provider, (FileInfo)fileSystemInfo);
}
示例3: FileEntry
public FileEntry(FileSystemInfo f)
{
_file = f;
_fileLength = -1;
if (_file.IsDirectory())
{
_mode = PathUtil.CombineDirectoryPath((DirectoryInfo)_file, Constants.DOT_GIT).Exists ? FileMode.GitLink : FileMode.Tree;
}
else if (_file.IsFile())
{
_mode = FS.canExecute(_file) ? FileMode.ExecutableFile : FileMode.RegularFile;
}
}
示例4: FileEntry
public FileEntry(FileSystemInfo f)
{
_file = f;
if (f.IsDirectory())
{
_isADirectory = true;
if (PathUtil.CombineDirectoryPath((DirectoryInfo)f, Constants.DOT_GIT).IsDirectory())
_mode = FileMode.GitLink;
else
_mode = FileMode.Tree;
}
else if (FS.canExecute(_file))
_mode = FileMode.ExecutableFile;
else
_mode = FileMode.RegularFile;
}