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


C# RelativePath.GetPathFromWorkingFolder方法代码示例

本文整理汇总了C#中RelativePath.GetPathFromWorkingFolder方法的典型用法代码示例。如果您正苦于以下问题:C# RelativePath.GetPathFromWorkingFolder方法的具体用法?C# RelativePath.GetPathFromWorkingFolder怎么用?C# RelativePath.GetPathFromWorkingFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RelativePath的用法示例。


在下文中一共展示了RelativePath.GetPathFromWorkingFolder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Copy

 public override void Copy(PathMapping sourceFilePath, RelativePath destFilePath)
 {
     var key = destFilePath.GetPathFromWorkingFolder();
     _mapping[key] = new PathMapping(key, sourceFilePath.PhysicalPath)
     {
         Properties = sourceFilePath.Properties,
     };
 }
开发者ID:vicancy,项目名称:docfx,代码行数:8,代码来源:LinkFileWriter.cs

示例2: PathMapping

 public PathMapping(RelativePath logicalPath, string physicalPath)
 {
     if (logicalPath == null)
     {
         throw new ArgumentNullException(nameof(logicalPath));
     }
     if (physicalPath == null)
     {
         throw new ArgumentNullException(nameof(physicalPath));
     }
     LogicalPath = logicalPath.GetPathFromWorkingFolder();
     PhysicalPath = physicalPath;
     AllowMoveOut = false;
     Properties = ImmutableDictionary<string, string>.Empty;
 }
开发者ID:vicancy,项目名称:docfx,代码行数:15,代码来源:PathMapping.cs

示例3: Create

 public override FileStream Create(RelativePath file)
 {
     var key = file.GetPathFromWorkingFolder();
     PathMapping pm;
     if (_mapping.TryGetValue(key, out pm) &&
         pm.PhysicalPath.StartsWith(OutputFolder))
     {
         return File.Create(Environment.ExpandEnvironmentVariables(pm.PhysicalPath));
     }
     var pair = CreateRandomFileStream();
     _mapping[key] =
         new PathMapping(
             key,
             Path.Combine(OutputFolder, pair.Item1));
     return pair.Item2;
 }
开发者ID:vicancy,项目名称:docfx,代码行数:16,代码来源:LinkFileWriter.cs

示例4: FindFile

 public PathMapping? FindFile(RelativePath file)
 {
     var path = file.GetPathFromWorkingFolder();
     foreach (var m in Mappings)
     {
         if (m.IsFolder)
         {
             var localPath = path - m.LogicalPath;
             if (m.AllowMoveOut || localPath.ParentDirectoryCount == 0)
             {
                 var physicalPath = Path.Combine(m.PhysicalPath, localPath.ToString());
                 if (File.Exists(Environment.ExpandEnvironmentVariables(physicalPath)))
                 {
                     return new PathMapping(path, physicalPath) { Properties = m.Properties };
                 }
             }
         }
         else if (m.LogicalPath == path)
         {
             return m;
         }
     }
     return null;
 }
开发者ID:vicancy,项目名称:docfx,代码行数:24,代码来源:LinkFileReader.cs


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