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


C# Queue.EnqueueRange方法代码示例

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


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

示例1: GetSubPageActive

        private object GetSubPageActive()
        {
            if (this.BookPage.SubPages == null)
            {
                return false;
            }

            // If this page is active, then no sub pages are active.
            //
            if (this.BookPage.Document == this.ActiveDocument)
            {
                return false;
            }

            var pages = new Queue<BookPage>(this.BookPage.SubPages);

            while (pages.Count > 0)
            {
                var page = pages.Dequeue();

                if (page.Document == this.ActiveDocument)
                {
                    return true;
                }

                if (page.SubPages != null)
                {
                    pages.EnqueueRange(page.SubPages);
                }
            }

            return false;
        }
开发者ID:fearthecowboy,项目名称:tinysite,代码行数:33,代码来源:DynamicBookPage.cs

示例2: Compile

 public override ExecutionEnvironment Compile(string source, string input)
 {
     var inputQ = new Queue<BigInteger>();
     switch (_settings.InputType)
     {
         case IOType.Numbers: try
             {
                 inputQ.EnqueueRange(input.Split(',').Where(s => !string.IsNullOrWhiteSpace(s)).Select(s => BigInteger.Parse(s)));
             }
             catch (FormatException)
             {
                 throw new Exception("Please provide the input as a comma-separated sequence of integers (or change the semantics in the Semantics menu).");
             }
             break;
         case IOType.Characters:
             inputQ.EnqueueRange(input.Select(ch => (BigInteger) (int) ch));
             break;
         default:
             throw new InvalidOperationException();
     }
     return BrainfuckEnv.GetEnvironment(_settings.CellType, source, inputQ, _settings.OutputType);
 }
开发者ID:Timwi,项目名称:EsotericIDE,代码行数:22,代码来源:Brainfuck.cs

示例3: featuresTree_AfterCheck

        void featuresTree_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (isAutoCheckingActive)
            {
                isAutoCheckingActive = false;
                bool newState = e.Node.Checked;
                var queue = new Queue<TreeNode>();
                queue.EnqueueRange(e.Node.Nodes.ToArray());

                while (queue.Any())
                {
                    var node = queue.Dequeue();
                    node.Checked = newState;
                    queue.EnqueueRange(node.Nodes.ToArray());

                }
                isAutoCheckingActive = true;
            }
        }
开发者ID:Eun,项目名称:WixSharp,代码行数:19,代码来源:FeaturesDialog.cs

示例4: AllContributingFiles

        public IEnumerable<SourceFile> AllContributingFiles()
        {
            var set = new HashSet<SourceFile>();

            var all = new Queue<SourceFile>(this.ContributingFiles);

            while (all.Count > 0)
            {
                var file = all.Dequeue();

                if (set.Add(file))
                {
                    all.EnqueueRange(file.ContributingFiles);
                }
            }

            return set;
        }
开发者ID:fearthecowboy,项目名称:tinysite,代码行数:18,代码来源:SourceFile.cs

示例5: GetPlaceholderCells

 public IEnumerable<GridCell> GetPlaceholderCells()
 {
     var result = new List<GridCell>();
     var rows = new Queue<GridRow>();
     rows.EnqueueRange(_rows);
     while (rows.Count > 0)
     {
         var row = rows.Dequeue();
         foreach (var cell in row.Cells)
         {
             if (cell.Type == GridLayoutCellType.Placeholder)
                 result.Add(cell);
             else if (cell.Type == GridLayoutCellType.InnerGrid)
             {
                 var grid = (GridLayout) cell;
                 rows.EnqueueRange(grid.Rows);
             }
         }
     }
     return result;
 }
开发者ID:jeppe-andreasen,项目名称:LinqIt-Libraries,代码行数:21,代码来源:GridLayout.cs

示例6: RebuildSearchIndex

 public void RebuildSearchIndex()
 {
     using (var service = new CrawlService("site"))
     {
         service.ClearDatabase();
     }
     Queue<Page> pages = new Queue<Page>();
     using (CmsContext.Published)
     {
         var siteRoots = CmsService.Instance.SelectItems<SiteRoot>("/Content/*/*{SiteRoot}");
         pages.EnqueueRange(siteRoots.SelectMany(r => r.GetChildren<Page>()));
         while (pages.Count > 0)
         {
             var page = pages.Dequeue();
             if (page.Template.Path.StartsWith("/WebPage"))
             {
                 var site = CmsService.Instance.GetSitePath(page.Path).Split('/').Last();
                 var thumbnail = page.GetValue<Image>("thumbnail");
                 SearchBackgroundCrawler.QueueDocumentAdd(site, page, thumbnail.Exists ? thumbnail.Url : string.Empty);
             }
             pages.EnqueueRange(page.GetChildren<Page>());
         }
     }
 }
开发者ID:jeppe-andreasen,项目名称:Umbraco-Public,代码行数:24,代码来源:DataService.cs

示例7: AllChapters

        private static IEnumerable<BookPage> AllChapters(Book book)
        {
            var queue = new Queue<BookPage>(book.Chapters);

            while (queue.Count > 0)
            {
                var page = queue.Dequeue();

                if (page.Chapter)
                {
                    queue.EnqueueRange(page.SubPages);

                    yield return page;
                }
            }
        }
开发者ID:fearthecowboy,项目名称:tinysite,代码行数:16,代码来源:OrderCommand.cs


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