本文整理汇总了C#中FilePath.IsNullOrEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# FilePath.IsNullOrEmpty方法的具体用法?C# FilePath.IsNullOrEmpty怎么用?C# FilePath.IsNullOrEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath.IsNullOrEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EagerlyResolveReferences
private void EagerlyResolveReferences(FilePath filename)
{
if (filename.IsNullOrEmpty())
return;
//TODO: Fix race condition on ResoleReferences method before re-enabling
//_taskFactory.StartNew(
// () =>
// {
// _log.InfoFormat("Eagerly Resolve References for [{0}]", filename);
//
// ResolveReferences(_buildProjectLoader.LoadMicrosoftBuildProject(filename));
// });
}
示例2: ReadProjectReferences
public IEnumerable<SolutionFileProjectReference> ReadProjectReferences(FilePath solutionFileName)
{
if (!_fileWrapper.Exists(solutionFileName))
throw new FileNotFoundException("Solution FileName", solutionFileName.FullPath);
if (solutionFileName.IsNullOrEmpty())
throw new ArgumentNullException("solutionFileName");
var directory = Path.GetDirectoryName(solutionFileName.FullPath);
if (null == directory)
throw new FormatException(string.Format("Path.GetDirectoryName returned null for solution file [{0}]", solutionFileName));
_log.InfoFormat("Reading Projects from Solution File [{0}]", solutionFileName.FullPath);
foreach (Match match in ProjectLinePattern.Matches(_fileReader.ReadAllText(solutionFileName)))
{
if (!match.Success)
continue;
string typeGuid = match.Groups["TypeGuid"].Value;
string title = match.Groups["Title"].Value;
string location = match.Groups["Location"].Value;
switch (typeGuid.ToUpperInvariant())
{
case "{2150E333-8FDC-42A3-9474-1A3956D46DE8}": // Solution Folder
// ignore folders
break;
case "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}": // C# project
yield return new SolutionFileProjectReference
{
ProjectFileName = new FilePath(directory, location),
Title = title
};
break;
default:
_log.InfoFormat("Project {0} has unsupported type {1}", location, typeGuid);
break;
}
}
}