本文整理汇总了C#中FileSystemPath.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystemPath.ToString方法的具体用法?C# FileSystemPath.ToString怎么用?C# FileSystemPath.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystemPath
的用法示例。
在下文中一共展示了FileSystemPath.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSingleFileSolution
protected Pair<ISolution, IProjectFile> CreateSingleFileSolution(string relativeProjectDirectory, string fileName, string [] systemAssemblies)
{
PlatformInfo platformInfo = PlatformManager.Instance.GetPlatformInfo("Standard", Environment.Version);
string projectDirectory = Path.Combine(testFilesDirectory, relativeProjectDirectory);
FileSystemPath filePath = new FileSystemPath(Path.Combine(projectDirectory, fileName));
if(!File.Exists(filePath.ToString()))
Assert.Fail("File does not exists {0}", filePath);
ISolution solution =
SolutionManager.Instance.CreateSolution(
new FileSystemPath(Path.Combine(projectDirectory, "TestSolution.sln")));
IProject project =
solution.CreateProject(new FileSystemPath(Path.Combine(projectDirectory, "TestProject.csproj")),
ProjectFileType.CSHARP,
platformInfo.PlatformID);
Arp.Common.Assertions.Assert.CheckNotNull(platformInfo);
project.AddAssemblyReference(platformInfo.MscorlibPath.ToString());
if(systemAssemblies != null)
{
foreach (string systemAssemblyName in systemAssemblies)
{
string assemblyPath = GetSystemAssemblyPath(platformInfo, systemAssemblyName);
project.AddAssemblyReference(assemblyPath);
}
}
IProjectFile file = project.CreateFile(filePath);
return new Pair<ISolution, IProjectFile>(solution, file);
}
示例2: GetRelativePath
private FileSystemPath GetRelativePath(FileSystemPath path)
{
var s = path.ToString();
var sindex = s.LastIndexOf(ArchiveDirectorySeparator.ToString() + FileSystemPath.DirectorySeparator);
if (sindex < 0)
return path;
return FileSystemPath.Parse(s.Substring(sindex + 1));
}
示例3: TryGetArchivePath
protected bool TryGetArchivePath(FileSystemPath path, out FileSystemPath archivePath)
{
var p = path.ToString();
var sindex = p.LastIndexOf(ArchiveDirectorySeparator.ToString() + FileSystemPath.DirectorySeparator);
if (sindex < 0)
{
archivePath = path;
return false;
}
archivePath = FileSystemPath.Parse(p.Substring(0, sindex));
return true;
}
示例4: HasArchive
protected bool HasArchive(FileSystemPath path)
{
return
path.ToString().LastIndexOf(ArchiveDirectorySeparator.ToString() + FileSystemPath.DirectorySeparator) >=
0;
}
示例5: GetPhysicalPath
public string GetPhysicalPath(FileSystemPath path)
{
return Path.Combine(PhysicalRoot, path.ToString().Remove(0, 1).Replace(FileSystemPath.DirectorySeparator, Path.DirectorySeparatorChar));
}
示例6: GetSevenZipPath
public string GetSevenZipPath(FileSystemPath path)
{
return path.ToString().Remove(0, 1);
}
示例7: ToEntryPath
protected string ToEntryPath(FileSystemPath path)
{
return path.ToString();
}