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


C# Collection.Concat方法代码示例

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


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

示例1: GetTabResults

 public IEnumerable<ITabResult> GetTabResults(IClient client, ITabQuery query)
 {
     IEnumerable<ITabResult> results = new Collection<ITabResult>();
     if (client != null && client.Users != null)
     {
         results = results.Concat(this.GetLogResults(client, query));
         results = results.Concat(this.GetVisibleUsersResults(client, query));
         results = results.Concat(this.GetAllUsersResults(client, query));
     }
     return results.Distinct();
 }
开发者ID:SilentPenguin,项目名称:Skyscraper,代码行数:11,代码来源:UserHandler.cs

示例2: GetTabResults

 public ITabResult GetTabResults(ITabQuery query)
 {
     IEnumerable<ITabResult> results = new Collection<ITabResult>();
     foreach(ITabHandler handler in this.tabHandlers){
         IEnumerable<ITabResult> handlerMatches = handler.GetTabResults(this.client, query);
         if (handlerMatches != null && handlerMatches.Count() > 0)
         {
             results = results.Concat(handlerMatches);
         }
     }
     return results.FirstOrDefault();
 }
开发者ID:SilentPenguin,项目名称:Skyscraper,代码行数:12,代码来源:TabComplete.cs

示例3: OnTick

        void OnTick(object state)
        {
            var ready = new Collection<Tuple<Guid, DateTime?>>();
            var notReady = new Collection<Tuple<Guid, DateTime?>>();

            try
            {
                Tuple<Guid, DateTime?> item;

                _eventStream.Publish<FailedJobQueue>(
                                                     EventType.TimerActivity,
                                                     EventProperty.ActivityName("RescheduleFailedJobs"),
                                                     EventProperty.Named("FailedItemsQueueLength", _jobFailures.Count));

                while (_jobFailures.TryTake(out item))
                {
                    if (item.Item2 < _now())
                        ready.Add(item);
                    else
                        notReady.Add(item);
                }

                foreach(var job in ready.Select(i => _persistenceStore.Load(i.Item1)))
                    _router.Route(job);

                ready.Clear();
            }
            catch (Exception e)
            {
                if (e.IsFatal())
                    throw;

                _eventStream.Publish<FailedJobQueue>(e);
            }
            finally
            {
                foreach(var item in ready.Concat(notReady))
                    _jobFailures.Add(item);

                _timer.Change(_configuration.RetryTimerInterval, Timeout.InfiniteTimeSpan);
            }
        }
开发者ID:GeeksDiary,项目名称:Molecules,代码行数:42,代码来源:FailedJobQueue.cs

示例4: WeaveType

        private void WeaveType(ModuleDefinition module, TypeDefinition type, Collection<CustomAttribute> assemblyMethodBoundaryAspects)
        {
            var classMethodBoundaryAspects = type.CustomAttributes;

            var propertyGetters = type.Properties
                .Where(x => x.GetMethod != null)
                .ToDictionary(x => x.GetMethod);

            var propertySetters = type.Properties
                .Where(x => x.SetMethod != null)
                .ToDictionary(x => x.SetMethod);

            var weavedAtLeastOneMethod = false;
            foreach (var method in type.Methods)
            {
                if (!IsWeavableMethod(method))
                    continue;

                Collection<CustomAttribute> methodMethodBoundaryAspects;

                if (method.IsGetter)
                    methodMethodBoundaryAspects = propertyGetters[method].CustomAttributes;
                else if (method.IsSetter)
                    methodMethodBoundaryAspects = propertySetters[method].CustomAttributes;
                else
                    methodMethodBoundaryAspects = method.CustomAttributes;

                var aspectInfos = assemblyMethodBoundaryAspects
                    .Concat(classMethodBoundaryAspects)
                    .Concat(methodMethodBoundaryAspects)
                    .Where(IsMethodBoundaryAspect)
                    .Select(x => new AspectInfo(x))
                    .ToList();
                if (aspectInfos.Count == 0)
                    continue;

                weavedAtLeastOneMethod = WeaveMethod(
                    module,
                    method,
                    aspectInfos);
            }   

            if (weavedAtLeastOneMethod)
                TotalWeavedTypes++;
        }
开发者ID:vescon,项目名称:MethodBoundaryAspect.Fody,代码行数:45,代码来源:ModuleWeaver.cs

示例5: Run

        private static int Run(RunConfig config)
        {
            IEnumerable<SearchContent> searchPieces = new Collection<SearchContent>();
            if (config.CleanLocalisations)
            {
                var keys = XamlKeys.Process(config.LocalisationPropertiesToIgnore, config.LocalisationResources);
                searchPieces = searchPieces.Concat(keys);
            }

            if (config.CleanStyles)
            {
                var styles = XamlStyles.Process(config.StyleResources);
                searchPieces = searchPieces.Concat(styles);
            }

            if (config.CleanImages)
            {
                var images = Images.Process(config.ImageExtensions, config.ImageRecurse, config.ImageFolders);
                searchPieces = searchPieces.Concat(images);
            }

            var xamlFiles = XamlFiles.FindXamlFiles(config.RootFolder);
            searchPieces = XamlFiles.Search(xamlFiles, searchPieces);

            if (config.ImageSearchInResources && config.CleanImages && config.CleanLocalisations)
            {
                searchPieces = XamlKeys.SearchLocalisationValues(config.LocalisationResources, searchPieces);
            }

            if (config.CleanLocalisations)
            {
                PrintResult(searchPieces, SearchContentType.ResourceID, "Resources with not match in XAML files", "No used resources :)");
            }

            if (config.CleanStyles)
            {
                PrintResult(searchPieces, SearchContentType.BasedOnStyle | SearchContentType.StyleKey, "Styles with no match in XAML files", "No used styles :)");
            }

            if (config.CleanImages)
            {
                PrintResult(searchPieces, SearchContentType.Image, "Images with no match in XAML files", "No used images :)");
            }

            if (config.Beep)
            {
                Console.Beep();
            }

            return (int)ExitCode.Success;
        }
开发者ID:rmaclean,项目名称:UXLR,代码行数:51,代码来源:Program.cs


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