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


C# FilePath.IsNullOrEmpty方法代码示例

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

示例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;
                }
            }
        }
开发者ID:prescottadam,项目名称:pMixins,代码行数:43,代码来源:SolutionFileReader.cs


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