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


C# IList.SelectMany方法代码示例

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


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

示例1: ExtractIntegrationJobTypesFromAssemblies

 public IList<Type> ExtractIntegrationJobTypesFromAssemblies(IList<Assembly> assembliesWithJobs)
 {
     return assembliesWithJobs
         .SelectMany(x => x.GetTypes())
         .Where(x => typeof(IIntegrationJob).IsAssignableFrom(x) && x.IsClass)
         .ToList();
 }
开发者ID:it88,项目名称:InEngine.NET,代码行数:7,代码来源:EngineHostCompositionRoot.cs

示例2: ContentLocator

        //todo: Link content to a content cache similar to openwraps package cache. Use same mechanism?
        public ContentLocator()
        {
            var environment = ServiceLocator.GetService<IEnvironment>();
            var packageManager = ServiceLocator.GetService<IPackageManager>();

            var baseDirectory = LocalFileSystem.Instance.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory);

            contentRoot = baseDirectory.GetDirectory("Content");
            contentRoot.MustExist();

            foreach (var scopedDescriptor in environment.ScopedDescriptors)
            {
                var files = packageManager.GetProjectExports<ContentFolderExport>(scopedDescriptor.Value.Value,
                                                                                  environment.ProjectRepository,
                                                                                  environment.ExecutionEnvironment);

                contentPathSources = files.SelectMany(x => x).Distinct().Select(x => x.Directory).ToList();
                foreach (
                    var pathSource in
                        contentPathSources.SelectMany(contentPathSource => contentPathSource.Directories()))
                {
                    pathSource.LinkTo(contentRoot.GetDirectory(pathSource.Name).MustExist().Path.FullPath);
                }
            }
        }
开发者ID:simonlaroche,项目名称:monorail-ow,代码行数:26,代码来源:ContentLocator.cs

示例3: SchemaScope

      public SchemaScope(JTokenType tokenType, IList<JsonSchemaModel> schemas)
      {
        _tokenType = tokenType;
        _schemas = schemas;

        _requiredProperties = schemas.SelectMany<JsonSchemaModel, string>(GetRequiredProperties).Distinct().ToDictionary(p => p, p => false);
      }
开发者ID:pvasek,项目名称:Newtonsoft.Json,代码行数:7,代码来源:JsonValidatingReader.cs

示例4: ColoriseDupFilesWithDifferentPaths

        private void ColoriseDupFilesWithDifferentPaths(ref IList<ProjectModel> projects)
        {
            // If there's a different version reference between 2 or more projects then flag this.
            // Example: ProjectA has EF 4.3.1. ProjectB has EF 5.0. We need to flag this in the UI.
            var children = projects.SelectMany(p => p.Children);
            children.Where(c => c.ItemType != "ProjectReference")
                .ToList()
                .ForEach(c =>
                    {
                        if (c.IsConflicting)
                            return;

                        var similar = children.Where(x => x.Filename.Equals(c.Filename, StringComparison.CurrentCultureIgnoreCase)
                            && !x.ItemLocation.Replace(@"..\", "").Equals(c.ItemLocation.Replace(@"..\", ""), StringComparison.CurrentCultureIgnoreCase)).ToList();
                        if (similar.Any())
                        {
                            int i = _r.Next(_pairedColors.Count - 1);
                            Color color = _pairedColors.Skip(i).First();
                            c.SimilarRefences = similar.ToList();
                            c.Color = color;
                            c.IsConflicting = true;
                            similar.ForEach(x =>
                                                {
                                                    x.Color = color;
                                                    x.IsConflicting = true;
                                                });
                        }
                    });
        }
开发者ID:Mozketo,项目名称:AccurateReferences,代码行数:29,代码来源:ReferenceEngine.cs

示例5: SearchForLunchMenuURLs

 /// <summary>
 /// Searches for lunch menu URLs through all search engines with given query strings.
 /// </summary>
 /// <param name="queries">Query-strings to search with.</param>
 public IList<string> SearchForLunchMenuURLs(IList<string> queries)
 {
     return queries.SelectMany(SearchForLunchMenuURLs)
                   .AsParallel()
                   .Distinct(new UrlComparer())
                   .ToList();
 }
开发者ID:mikkoj,项目名称:LunchCrawler,代码行数:11,代码来源:LunchRestaurantSearchEngine.cs

示例6: FactoryClass

 public FactoryClass(IConstructorArgList argList, IList<IFactoryMethod> methods)
 {
     m_argList = argList;
     Methods = methods;
     foreach (var definition in methods.SelectMany(m => m.ConstructorArgs))
         argList.Add(definition);
 }
开发者ID:DivineInject,项目名称:DivineInject,代码行数:7,代码来源:FactoryClass.cs

示例7: Escape

 private static List<byte> Escape(IList<byte> p)
 {
     return p.SelectMany(q =>
         q == 0x7E ? new byte[] { 0x7d, 0x02 }
             : (q == 0x7D ? new byte[] { 0x7D, 0x01 }
                 : new[] { q })
     ).ToList();
 }
开发者ID:hhahh2011,项目名称:CH.Spartan,代码行数:8,代码来源:Jt808Packer.cs

示例8: MapToTimeSlot

        /// <summary>
        ///     Mapping list of date models into list of timeslot models
        /// </summary>
        /// <param name="dates">List of date models</param>
        /// <returns>List of timeslot models</returns>

        public static IList<TimeSlot> MapToTimeSlot(IList<EventModel.DatesModel> dates)
        {
            return dates.SelectMany(d => d.Times.Select(time => new TimeSlot()
            {
                Id = time.Id.GetValueOrDefault(),
                DateTime = d.Date.Add(TimeSpan.Parse(time.Time))
            }).ToList()).ToList();
        }
开发者ID:tomaskristof,项目名称:event-planner,代码行数:14,代码来源:MappingHelper.cs

示例9: GetUsersCatalogs

        public IList<CatalogDto> GetUsersCatalogs(IList<long> userIds)
        {
            var userCatalogIds = userIds
                    .SelectMany(x => Call<IList<long>>("get-user-catalogs", new { UserId = x }))
                    .Distinct().ToArray();

            return Get(userCatalogIds);
        }
开发者ID:SYW,项目名称:social-insight,代码行数:8,代码来源:CatalogsApi.cs

示例10: ValidatedContractBlock

        public ValidatedContractBlock(IList<ValidatedStatement> validatedContractBlock)
        {
            Contract.Requires(validatedContractBlock != null);

            _validatedContractBlock = validatedContractBlock;

            _contractBlock = validatedContractBlock.Select(x => x.ProcessedStatement).ToList();
            _validationResults = validatedContractBlock.SelectMany(x => x.ValidationResults).ToList();
        }
开发者ID:remyblok,项目名称:ReSharperContractExtensions,代码行数:9,代码来源:ValidatedContractBlock.cs

示例11: UpdateValues

        public bool UpdateValues(IList<AFValues> valsList)
        {
            IList<AFValue> valsToWrite = new List<AFValue>();

            valsToWrite = valsList.SelectMany(i => i).ToList();

            AFErrors<AFValue> errors = AFListData.UpdateValues(valsToWrite, AFUpdateOption.Replace);

            return (errors == null) ? true : false;
        }
开发者ID:pthivierge,项目名称:PIFitness.Main,代码行数:10,代码来源:ValueWriter.cs

示例12: GenerateMembers

 private IList<ISymbol> GenerateMembers(
     IList<Tuple<INamedTypeSymbol, IList<ISymbol>>> unimplementedMembers,
     CancellationToken cancellationToken)
 {
     return
         unimplementedMembers.SelectMany(t => t.Item2)
                             .Select(m => GenerateMember(m, cancellationToken))
                             .WhereNotNull()
                             .ToList();
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:10,代码来源:AbstractImplementAbstractClassService.Editor.cs

示例13: GetPointsPerMinute

 public double GetPointsPerMinute(IList<Player> players, bool? homeFixtures)
 {
     var fixtures = players.SelectMany(p => p.PastFixtures).ToList();
     if(homeFixtures.HasValue)
     {
         fixtures = fixtures.Where(pf => pf.Home == homeFixtures).ToList();
     }
     var totalMinutes = fixtures.Sum(f => f.MinutesPlayed);
     var totalPoints = fixtures.Sum(f => f.TotalPointsScored);
     return totalPoints/(double)totalMinutes;
 }
开发者ID:robinweston,项目名称:fantasyfootballrobot,代码行数:11,代码来源:LocationAdvantageCalculator.cs

示例14: Game

        public Game(IList<Team> teams, Contract contract, IEnumerable<Card> deck, ILogger logger)
        {
            _logger = logger;
            Contract = contract;

            Teams = teams;
            _numberOfPlayers = teams.SelectMany(t => t.Players).Count();

            Declarer = Contract.Team.Players.First(); // TODO: This probably isn't right!
            Dummy = Contract.Team.Players.Last(); // TODO: This probably isn't right!

            Deal(deck, Declarer); //TODO: This Probably isn't right!
        }
开发者ID:alastairs,项目名称:BridgeSolver,代码行数:13,代码来源:Game.cs

示例15: SchemaScope

            public SchemaScope(JTokenType tokenType, IList<JsonSchemaModel> schemas)
            {
                _tokenType = tokenType;
                _schemas = schemas;

                _requiredProperties = schemas.SelectMany<JsonSchemaModel, string>(GetRequiredProperties).Distinct().ToDictionary(p => p, p => false);

                if (tokenType == JTokenType.Array && schemas.Any(s => s.UniqueItems))
                {
                    IsUniqueArray = true;
                    UniqueArrayItems = new List<JToken>();
                }
            }
开发者ID:yonglehou,项目名称:microservice_workshop,代码行数:13,代码来源:JsonValidatingReader.cs


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