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


C# IReadOnlyCollection.Contains方法代码示例

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


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

示例1: getSizes

 private static IEnumerable<int> getSizes(IReadOnlyCollection<string> args)
 {
     var numberOfFilesystemArguments = args.Contains(recursive) ? 2 : 1;
     var sizes = args.Count == numberOfFilesystemArguments
         ? defaultSizes
         : args.Skip(numberOfFilesystemArguments).Select(a => Convert.ToInt32(a));
     return sizes;
 }
开发者ID:stevedesmond-ca,项目名称:ImageResizer,代码行数:8,代码来源:Program.cs

示例2: TasClientOnFriendListUpdated

 private void TasClientOnFriendListUpdated(object sender, IReadOnlyCollection<string> friends)
 {
     foreach (var battleID in Program.TasClient.ExistingUsers.Values.Where(b => friends.Contains(b.Name) && b.BattleID.HasValue).Select(x=>x.BattleID))
     {
         var battleIcon = GetBattleIcon(battleID??0);
         battleIcon.SetPlayers();
         BattleChanged(this, new EventArgs<BattleIcon>(battleIcon));
     }
 }
开发者ID:GoogleFrog,项目名称:Zero-K-Infrastructure,代码行数:9,代码来源:BattleIconManager.cs

示例3: TasClientOnFriendListUpdated

 private void TasClientOnFriendListUpdated(object sender, IReadOnlyCollection<string> friends)
 {
     foreach (var battle in Program.TasClient.ExistingBattles.Values.Where(b => b.Users.Any(y => friends.Contains(y.Key))))
     {
         var battleIcon = GetBattleIcon(battle.BattleID);
         battleIcon.SetPlayers();
         BattleChanged(this, new EventArgs<BattleIcon>(battleIcon));
     }
 }
开发者ID:DeinFreund,项目名称:Zero-K-Infrastructure,代码行数:9,代码来源:BattleIconManager.cs

示例4: Files

        /// <summary>
        /// The files in a project.
        /// </summary>
        /// <param name="fileExtensionFilter">Any file extensions to filter out. If empty, all file extensions are returned.</param>
        /// <returns></returns>
        public IEnumerable<TfsFile> Files(IReadOnlyCollection<string> fileExtensionFilter)
        {
            var projectDir = Path.GetDirectoryName(ServerPath);

            return _projectDocument.Value
                .Descendants(XName.Get("Compile", ProjectNamespace)).Concat(_projectDocument.Value
                .Descendants(XName.Get("None", ProjectNamespace)))
                .Select(e => Path.Combine(projectDir, e.Attribute(XName.Get("Include")).Value))
                .Where(p => fileExtensionFilter.Count == 0 || fileExtensionFilter.Contains(Path.GetExtension(p)))
                .Select(p => VersionControl.GetItem(p))
                .Select(i => new TfsFile(i, VersionControl));
        }
开发者ID:testpulse,项目名称:TFSTestCaseAutomator,代码行数:17,代码来源:TfsSolutionProject.cs

示例5: RemoveLines

        private void RemoveLines(IReadOnlyCollection<int> indices) {
            var visualsToRemove = new List<VisualTextLine>();

            foreach (var visual in visuals) {
                var line = (VisualTextLine)visual;

                if (indices.Contains(line.Index)) {
                    visualsToRemove.Add(line);
                }
            }
            foreach (var line in visualsToRemove) {
                visuals.Remove(line);
            }
        }
开发者ID:mmalek06,项目名称:FunkyCodeEditor,代码行数:14,代码来源:TextViewRendering.cs

示例6: ByProjectAndCategories

 public static FindSpecification<Model.Statistics.FirmCategory3> ByProjectAndCategories(long projectId, IReadOnlyCollection<long?> categoryIds)
 {
     return new FindSpecification<Model.Statistics.FirmCategory3>(x => x.ProjectId == projectId && categoryIds.Contains(x.CategoryId));
 }
开发者ID:denisivan0v,项目名称:nuclear-river,代码行数:4,代码来源:Specs.Find.CI.cs

示例7: ProjectCategories

 public static FindSpecification<ProjectCategory> ProjectCategories(IReadOnlyCollection<long> aggregateIds)
 {
     return new FindSpecification<ProjectCategory>(x => aggregateIds.Contains(x.ProjectId));
 }
开发者ID:denisivan0v,项目名称:nuclear-river,代码行数:4,代码来源:Specs.Find.CI.cs

示例8: FirmTerritories

 public static FindSpecification<FirmTerritory> FirmTerritories(IReadOnlyCollection<long> aggregateIds)
 {
     return new FindSpecification<FirmTerritory>(x => aggregateIds.Contains(x.FirmId));
 }
开发者ID:denisivan0v,项目名称:nuclear-river,代码行数:4,代码来源:Specs.Find.CI.cs

示例9: ClientContacts

 public static FindSpecification<ClientContact> ClientContacts(IReadOnlyCollection<long> aggregateIds)
 {
     return new FindSpecification<ClientContact>(x => aggregateIds.Contains(x.ClientId));
 }
开发者ID:denisivan0v,项目名称:nuclear-river,代码行数:4,代码来源:Specs.Find.CI.cs

示例10: CompareWrap

 private static void CompareWrap(ObservableCollection<string> targetColl, IReadOnlyCollection<string> wcoll, string t1, string t2)
 {
     Assert.AreEqual(targetColl.Count, wcoll.Count);
     Assert.AreEqual(targetColl.Contains(t1), wcoll.Contains(t1));
     Assert.AreEqual(targetColl.Contains(t2), wcoll.Contains(t2));
     for (int i = 0; i < targetColl.Count; i++)
     {
         Assert.AreEqual(targetColl[i], wcoll[i]);
     }
 }
开发者ID:ganouver,项目名称:gdk,代码行数:10,代码来源:TestCollections.cs

示例11: ModelChildrenCollectionChanged

		void ModelChildrenCollectionChanged(IReadOnlyCollection<object> removedItems, IReadOnlyCollection<object> addedItems)
		{
			if (!IsVisible) {
				SwitchBackToLazyLoading();
				return;
			}
			Children.RemoveAll(n => removedItems.Contains(n.Model));
			InsertChildren(addedItems);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:9,代码来源:ModelCollectionTreeNode.cs

示例12: GetEmailAddressesForUserKeysAsync

        public async Task<IDictionary<int, string>> GetEmailAddressesForUserKeysAsync(IReadOnlyCollection<int> distinctUserKeys)
        {
            var results = await UserRepository.GetAll()
                .Where(u => distinctUserKeys.Contains(u.Key))
                .Select(u => new { u.Key, u.EmailAddress })
                .ToDictionaryAsync(u => u.Key, u => u.EmailAddress);

            return results;
        }
开发者ID:goitsk,项目名称:NuGetGallery,代码行数:9,代码来源:UserService.cs

示例13: AssertRoleListCorrectness

		/// <summary>
		/// Убедиться в корректности списка ролей пользователя
		/// </summary>
		/// <param name="roles">Список ролей</param>
		/// <exception cref="IncorrectRoleListException">Список ролей некорректен</exception>
		private static void AssertRoleListCorrectness(IReadOnlyCollection<string> roles)
		{
			if (roles.Contains("buildserver") && roles.Count > 1)
			{
				throw new IncorrectRoleListException();
			}
		}
开发者ID:lexarchik,项目名称:BuildRevisionCounter,代码行数:12,代码来源:MongoUserRepository.cs

示例14: RunAlbumWorkflows

        private void RunAlbumWorkflows(
            IReadOnlyCollection<IITTrack> tracksToFix,
            IReadOnlyCollection<Workflow> albumWorkflows)
        {
            if (albumWorkflows.Count == 0)
            {
                return;
            }

            NewState(0, tracksToFix.Count, "Generating album list...");

            var albums = new Dictionary<string,List<IITTrack>>();

            foreach (var track in tracksToFix)
            {
                if (!albums.ContainsKey(track.Album))
                {
                    albums.Add(track.Album, new List<IITTrack> {track});
                }
                else
                {
                    albums[track.Album].Add(track);
                }

                ItemsProcessed++;
            }

            NewState(0, albums.Count, "Running album workflows...");

            foreach (var album in albums)
            {
                // have to set number before count in case old number is higher than count
                if (albumWorkflows.Contains(Workflow.FixTrackNumbers))
                {
                    var trackComparer = TrackComparerFactory.GetTrackComparer(album.Value);
                    album.Value.Sort(trackComparer);
                    for (var i = 0; i < album.Value.Count; i++)
                    {
                        album.Value[i].TrackNumber = i + 1;
                    }
                }

                if (albumWorkflows.Contains(Workflow.FixCountOfTracksOnAlbum))
                {
                    foreach (var track in album.Value)
                    {
                        track.TrackCount = album.Value.Count;
                    }
                }

                ItemsProcessed++;
            }
        }
开发者ID:jasonracey,项目名称:iTunesAssistant,代码行数:53,代码来源:WorkflowRunner.cs

示例15: RemoveAuctions

		public async Task RemoveAuctions(IReadOnlyCollection<int> ids, string removingUserId, IValidationErrorNotifier errors)
		{
			var auctions = await mContext.Auctions.Include(x => x.Offers).Where(x => ids.Contains(x.Id)).ToListAsync();
			if(!await auctions.All(async x => await CanBeRemoved(x, removingUserId, errors)))
				return;

			await mContext.Auctions.Where(x => ids.Contains(x.Id)).DeleteAsync();

			foreach(var auctionId in ids)
			{
				RemoveAuctionPhotos(auctionId);
			}
		}
开发者ID:Strachu,项目名称:Auctioneer,代码行数:13,代码来源:AuctionService.cs


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