本文整理汇总了C#中ICollection.None方法的典型用法代码示例。如果您正苦于以下问题:C# ICollection.None方法的具体用法?C# ICollection.None怎么用?C# ICollection.None使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICollection
的用法示例。
在下文中一共展示了ICollection.None方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ForceLoadAllReferencedAssemblies
private static void ForceLoadAllReferencedAssemblies(Assembly[] assembliesToTraverse, ICollection<AssemblyName> alreadyLoaded)
{
foreach (var assembly in assembliesToTraverse)
{
if (!IsMyAssembly(assembly.GetName())) continue;
var referencedAssemblies = assembly.GetReferencedAssemblies();
var unloadedReferencedAssemblies = referencedAssemblies
.Where(an => alreadyLoaded.None(already => already.FullName == an.FullName))
.ToArray();
var newlyLoadedAssemblies = unloadedReferencedAssemblies
.Do(alreadyLoaded.Add)
.Select(Assembly.Load)
.ToArray();
ForceLoadAllReferencedAssemblies(newlyLoadedAssemblies, alreadyLoaded);
}
}
示例2: IncludeStatementTransactions
private static IEnumerable<LedgerTransaction> IncludeStatementTransactions(LedgerEntry newEntry, ICollection<Transaction> filteredStatementTransactions)
{
if (filteredStatementTransactions.None())
{
return new List<LedgerTransaction>();
}
List<Transaction> transactions =
filteredStatementTransactions.Where(t => t.BudgetBucket == newEntry.LedgerBucket.BudgetBucket).ToList();
if (transactions.Any())
{
IEnumerable<LedgerTransaction> newLedgerTransactions = transactions.Select(
t =>
{
if (t.Amount < 0)
{
return new CreditLedgerTransaction(t.Id)
{
Amount = t.Amount,
Narrative = ExtractNarrative(t),
Date = t.Date
};
}
return new CreditLedgerTransaction(t.Id)
{
Amount = t.Amount,
Narrative = ExtractNarrative(t),
Date = t.Date
};
});
return newLedgerTransactions.ToList();
}
return new List<LedgerTransaction>();
}