本文整理汇总了C#中FilePath.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# FilePath.Navigate方法的具体用法?C# FilePath.Navigate怎么用?C# FilePath.Navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath.Navigate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadMasters
public void ReadMasters(FilePath rootPath, FilePath[] masters)
{
foreach (var master in masters)
{
var fullPath = rootPath.Navigate(master);
if (!Directory.Exists(fullPath.ToEnvironmentalPath())) continue;
SetByLatest(fullPath, _masters, "*");
}
}
示例2: DeletePath
public void DeletePath(FilePath path)
{
var epath = path.ToEnvironmentalPath();
var gitPath = path.Navigate((FilePath)".git").ToEnvironmentalPath();
if (Directory.Exists(gitPath)) Directory.Delete(gitPath, true);
if (Directory.Exists(epath))
Directory.Delete(epath, true);
else
File.Delete(epath);
}
示例3: Build
public int Build(FilePath rootPath, FilePath buildPath)
{
var path = _files.GetFirstMatch(buildPath, _patterns.BuildPattern);
if (path == null) return 0;
foreach (var copyPath in _patterns.CopyPaths)
{
var src = rootPath.Navigate(copyPath.Source);
var dst = buildPath.Navigate(copyPath.Destination);
if (_files.Exists(src))
_files.CopyDirectory(src, dst);
}
var command = string.Format(_patterns.BuildCmd, path.LastElement());
Log.Verbose(command);
return buildPath.Call("cmd", "/c " + command);
}
示例4: RebuildByScripts
private void RebuildByScripts(FilePath projPath)
{
var dbPath = projPath.Navigate((FilePath) "DatabaseScripts");
var selfPath = projPath.Navigate((FilePath)"../DatabaseScripts");
var sqlSpecificPath = dbPath.Navigate((FilePath) "SqlServer");
if (!_files.Exists(dbPath))
{
if (_files.Exists(selfPath)) dbPath = selfPath;
else return;
}
Log.Status("Scripts from " + dbPath.ToEnvironmentalPath());
var finalSrcPath = (_files.Exists(sqlSpecificPath)) ? (sqlSpecificPath) : (dbPath);
foreach (var file in _files.SortedDescendants(finalSrcPath, "*.sql"))
{
Log.Verbose(file.LastElement());
_builder.RunSqlScripts(projPath, file);
}
}
示例5: DependencyRulePath
FilePath DependencyRulePath(FilePath filePath, string path)
{
return filePath.Navigate((FilePath)path)
.Navigate(_patterns.DependencyPath).Navigate((FilePath)"Depends.rule");
}