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


C# ISet.RemoveAll方法代码示例

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


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

示例1: MappingsQueueEntry

        public MappingsQueueEntry(NamedXmlDocument document, ICollection classEntries)
        {
            this.document = document;

            containedClassNames = GetClassNames(classEntries);
            requiredClassNames = GetExtendsNames(classEntries);
            requiredClassNames.RemoveAll(containedClassNames);
        }
开发者ID:zibler,项目名称:zibler,代码行数:8,代码来源:MappingsQueueEntry.cs

示例2: OrderedHbmFiles

		/// <summary>
		/// Returns an <see cref="IList"/> of <c>hbm.xml</c> files in the order that ensures
		/// base classes are loaded before their subclass/joined-subclass.
		/// </summary>
		/// <param name="unorderedClasses">An <see cref="ISet"/> of <see cref="ClassEntry"/> objects.</param>
		/// <returns>
		/// An <see cref="IList"/> of <see cref="String"/> objects that contain the <c>hbm.xml</c> file names.
		/// </returns>
        private static ArrayList OrderedHbmFiles(ISet unorderedClasses)
		{
			// Make sure joined-subclass mappings are loaded after base class
			ArrayList sortedList = new ArrayList();
			ISet processedClassNames = new HashedSet();
			ArrayList processedInThisIteration = new ArrayList();

			while (true)
			{
				foreach (ClassEntry ce in unorderedClasses)
				{
                    if (ce.FullExtends == null || processedClassNames.Contains(ce.FullExtends))
					{
						// This class extends nothing, or is derived from one of the classes that were already processed.
						// Append it to the list since it's safe to process now.
						// but only if the list doesn't already contain an entry for this file (each file should only appear once in the list)
						if (!CollectionUtils.Contains(sortedList,
							delegate(object entry) { return ((ClassEntry)entry).FileName == ce.FileName; }))
						{
							sortedList.Add(ce);
						}
						processedClassNames.Add(ce.FullClassName);
						processedInThisIteration.Add(ce);
					}
				}

				unorderedClasses.RemoveAll(processedInThisIteration);

				if (processedInThisIteration.Count == 0)
				{
					if (!unorderedClasses.IsEmpty)
					{
						throw new NHibernate.MappingException(FormatExceptionMessage(unorderedClasses));
					}
					break;
				}

				processedInThisIteration.Clear();
			}

            return sortedList;
		}
开发者ID:tcchau,项目名称:ClearCanvas,代码行数:50,代码来源:AssembliesHbmOrderer.cs


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