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


C# Area.InExtern方法代码示例

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


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

示例1: PopulateList

        private static List<Entry> PopulateList(Area area, Entry parentEntry, DirectoryInfo info, string subdirectory, DirectoryInfo adminFolder, bool ignoreDirectory)
        {
            List<Entry> result = new List<Entry>();
            if (area.InExtern(info))
                return result;
            bool ignoreContents = false;
            string slashedSubdirectory = subdirectory;
            if (subdirectory != string.Empty)
            {
                if (slashedSubdirectory[slashedSubdirectory.Length - 1] != '/')
                    slashedSubdirectory += '/';
                if (area != null && area.Directives != null && area.Directives.Include != null)
                {
                    ignoreDirectory = true;
                    foreach (var y in area.Directives.Include.Directories)
                    {
                        if (y.StartsWith(slashedSubdirectory, StringComparison.OrdinalIgnoreCase))
                        {
                            if (slashedSubdirectory.Length <= y.Length - 1)
                                ignoreContents = true;
                            ignoreDirectory = false;
                            break;
                        }
                        else if (slashedSubdirectory.StartsWith(y))
                        {
                            ignoreDirectory = false;
                            break;
                        }
                    }
                    if (area.Directives.Include.RegexDirectoryPatterns != null)
                    {
                        foreach (var y in area.Directives.Include.RegexDirectoryPatterns)
                        {
                            if (y.IsMatch(slashedSubdirectory))
                            {
                                ignoreDirectory = false;
                                break;
                            }
                        }
                    }
                }
                if (area != null && area.Directives != null && area.Directives.Ignore != null && area.Directives.Ignore.RegexDirectoryPatterns != null)
                {
                    foreach (var y in area.Directives.Ignore.Directories)
                    {
                        if (slashedSubdirectory.StartsWith(y, StringComparison.OrdinalIgnoreCase))
                        {
                            ignoreDirectory = true;
                            break;
                        }
                    }
                    foreach (var y in area.Directives.Ignore.RegexDirectoryPatterns)
					{
                        if (y.IsMatch(slashedSubdirectory))
						{
							ignoreDirectory = true;
							break;
						}
					}
				}
                
                if (area != null && area.Directives != null && area.Directives.Externals != null)
                {
                    foreach (var x in area.Directives.Externals)
                    {
                        string extdir = x.Value.Location.Replace('\\', '/');
                        if (!extdir.EndsWith("/"))
                            extdir += "/";
                        if (string.Equals(slashedSubdirectory, extdir, StringComparison.OrdinalIgnoreCase))
                        {
                            return result;
                        }
                    }
                }

				parentEntry = new Entry(area, parentEntry, info, slashedSubdirectory, ignoreDirectory);
                result.Add(parentEntry);
                if (ignoreDirectory)
                    return result;
            }

			// Don't add children for symlinks.
			if (Utilities.Symlink.Exists(info))
				return result;

            List<Task<List<Entry>>> tasks = new List<Task<List<Entry>>>();
            string prefix = string.IsNullOrEmpty(subdirectory) ? string.Empty : slashedSubdirectory;
            foreach (var x in info.GetFileSystemInfos())
            {
                string fn = x.Name;
                string name = prefix + fn;
                if (x.Attributes.HasFlag(FileAttributes.Directory))
                {
                    if (fn == "." || fn == "..")
                        continue;
                    
                    if (x.Name == ".versionr")
                        continue;

#if DEBUG
//.........这里部分代码省略.........
开发者ID:eatplayhate,项目名称:versionr,代码行数:101,代码来源:FileStatus.cs


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