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


C# ICollection.None方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:fenix2222,项目名称:Nimbus,代码行数:17,代码来源:AppDomainScanner.cs

示例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>();
        }
开发者ID:Benrnz,项目名称:BudgetAnalyser,代码行数:37,代码来源:ReconciliationBuilder.cs


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