本文整理汇总了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);
}
示例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;
}