本文整理汇总了C#中PathInfo.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PathInfo.ToString方法的具体用法?C# PathInfo.ToString怎么用?C# PathInfo.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathInfo
的用法示例。
在下文中一共展示了PathInfo.ToString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FileProjectItem
public FileProjectItem(string kind, IFileInfo fileInfo, IFileSystem fileSystem, PathInfo subPath)
: base(subPath.ToString(), kind)
{
_subPath = subPath;
_fileSystem = fileSystem;
FileInfo = fileInfo;
}
示例2: ZipFileSystem
public ZipFileSystem(string filePath, string rootPath)
{
_filePath = PathInfo.Create(filePath);
_rootPath = PathInfo.Create(rootPath);
_rootPathString = _rootPath.ToString();
_rootPathLength = _rootPathString.Length;
_file = new ZipFile(filePath);
_etag = new FileInfo(filePath).LastWriteTimeUtc.Ticks.ToString("X8");
}
示例3: TryReadPageDefinition
private bool TryReadPageDefinition(out IPageViewDefinition viewDefinition, PathInfo fileName)
{
using (var reader = new JsonTextReader(new StreamReader(_fileSystem.OpenRead(fileName))))
{
viewDefinition = Deserialize(reader);
if (viewDefinition == null)
return false;
viewDefinition.Id = fileName.ToString();
return true;
}
}
示例4: Create
public static FileInfo Create(PathInfo filePath)
{
var fileInfo = new System.IO.FileInfo(filePath.ToString());
if (!fileInfo.Exists)
return null;
return new FileInfo(filePath, fileInfo);
}
示例5: GetExtension
public string GetExtension(PathInfo path)
{
return System.IO.Path.GetExtension(path.ToString());
}
示例6: GetFileNameWithoutExtension
public PathInfo GetFileNameWithoutExtension(PathInfo path)
{
return PathInfo.Create(System.IO.Path.GetFileNameWithoutExtension(path.ToString()));
}
示例7: ChangeExtension
public PathInfo ChangeExtension(PathInfo fileName, string extension)
{
return PathInfo.Create(System.IO.Path.ChangeExtension(fileName.ToString(), extension));
}
示例8: GetDirectoryName
public PathInfo GetDirectoryName(PathInfo filePath)
{
return PathInfo.Create(System.IO.Path.GetDirectoryName(filePath.ToString()));
}
示例9: IsMatch
public bool IsMatch(PathInfo path)
{
return _regex.IsMatch(path.ToString());
}