当前位置: 首页>>代码示例>>C#>>正文


C# FileSystemPath.ToString方法代码示例

本文整理汇总了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);
        }
开发者ID:willrawls,项目名称:arp,代码行数:33,代码来源:BaseTest.cs

示例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));
 }
开发者ID:Maxwolf,项目名称:FakeFilesystem,代码行数:8,代码来源:SeamlessArchiveFileSystem.cs

示例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;
 }
开发者ID:Maxwolf,项目名称:FakeFilesystem,代码行数:12,代码来源:SeamlessArchiveFileSystem.cs

示例4: HasArchive

 protected bool HasArchive(FileSystemPath path)
 {
     return
         path.ToString().LastIndexOf(ArchiveDirectorySeparator.ToString() + FileSystemPath.DirectorySeparator) >=
         0;
 }
开发者ID:Maxwolf,项目名称:FakeFilesystem,代码行数:6,代码来源:SeamlessArchiveFileSystem.cs

示例5: GetPhysicalPath

 public string GetPhysicalPath(FileSystemPath path)
 {
     return Path.Combine(PhysicalRoot, path.ToString().Remove(0, 1).Replace(FileSystemPath.DirectorySeparator, Path.DirectorySeparatorChar));
 }
开发者ID:Mexahoid,项目名称:CSF,代码行数:4,代码来源:PhysicalFileSystem.cs

示例6: GetSevenZipPath

 public string GetSevenZipPath(FileSystemPath path)
 {
     return path.ToString().Remove(0, 1);
 }
开发者ID:Mexahoid,项目名称:CSF,代码行数:4,代码来源:SevenZipFileSystem.cs

示例7: ToEntryPath

 protected string ToEntryPath(FileSystemPath path)
 {
     return path.ToString();
 }
开发者ID:readelivery,项目名称:sharpfilesystem,代码行数:4,代码来源:SharpZipLibFileSystem.cs


注:本文中的FileSystemPath.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。