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


C# BindingList.Any方法代码示例

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


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

示例1: add

    private void add(BindingList<BondSpreadLine> list_, CountryBondSource src1_, CountryBondSource src2_, bool firstFirst_)
    {
      Array.ForEach(src1_.Lines.ToArray(), benchBond =>
      {
        var closestBond =
          src2_.Lines.Select(x => new { Diff = Math.Abs((benchBond.Maturity - x.Maturity).TotalDays), Item = x })
            .OrderBy(x => x.Diff)
            .First();

        if (closestBond.Diff > DaysDiffTolerance) return;

        var line = firstFirst_ ? new BondSpreadLine(benchBond, closestBond.Item) : new BondSpreadLine(closestBond.Item, benchBond);

        if (
          list_.Any(
            x => object.ReferenceEquals(x.Lines[0], line.Lines[0]) && object.ReferenceEquals(x.Lines[1], line.Lines[1])))
          line.Dispose();
        else
          list_.Add(line);
      });
    }
开发者ID:heimanhon,项目名称:researchwork,代码行数:21,代码来源:CountrySpreadsLines.cs

示例2: SetDataSource

        public void SetDataSource(BindingList<string> datasource)
        {
            this.StringBindingList = new BindingList<StringObject>();
            this.origDataSource = datasource;

            var items = from s in datasource orderby s select s;

            foreach (var s in items)
            {
                if (!StringBindingList.Any(item => item.Text == s))
                {
                    StringBindingList.Add(new StringObject { Text = s });
                }
            }

            this.SetDataSourceList();

            gridControl.DataSource = StringBindingList;
            gridControl.Enabled = true;

            StringBindingList.AddingNew += this.StringBindingList_AddingNew;
            StringBindingList.ListChanged += this.StringBindingList_ListChanged;
        }
开发者ID:rsanch1,项目名称:YANFOE.v2,代码行数:23,代码来源:ListEditUserControl.cs

示例3: UpdateItemOnGrid

 private void UpdateItemOnGrid(BindingList<MarketViewItem> marketViewItems, MarketViewItem marketItem)
 {
     if (marketViewItems.Any(m => m.Instrument == marketItem.Instrument))
     {
         for (int i = 0; i < marketViewItems.Count; i++)
         {
             if (marketViewItems[i].Instrument == marketItem.Instrument)
             {
                 marketViewItems[i] = marketItem;
             }
         }
     }
     else
     {
         marketViewItems.Add(marketItem);
     }
 }
开发者ID:heimanhon,项目名称:researchwork,代码行数:17,代码来源:MarketViewModel.cs

示例4: DeleteConcreteEntities

        public void DeleteConcreteEntities(BindingList<TestForGrid> testGrids, BindingList<SpecimenForGrid> specimenGrids, BindingList<TubeForGrid> tubeGrids, BindingList<IndicationForGrid> indicationGrids, string orderNumber)
        {
            var oldConcreteTests = OrderService.FindConcreteTestsByOrder(orderNumber);
            foreach (var oldConcreteTest in oldConcreteTests)
            {
                if (!testGrids.Any(testGrid => testGrid.ConcreteCode == oldConcreteTest.Code))
                {
                    OrderService.DeleteConcreteTest(oldConcreteTest.Code);
                }
            }

            var oldConcreteSpecimens = OrderService.FindConcreteSpecimensByOrder(orderNumber);
            foreach (var oldConcreteSpecimen in oldConcreteSpecimens)
            {
                if (specimenGrids.SingleOrDefault<SpecimenForGrid>(specimenGrid => specimenGrid.ConcreteCode == oldConcreteSpecimen.Code) == null)
                {
                    OrderService.DeleteConcreteSpecimen(oldConcreteSpecimen.Code);
                }
            }

            var oldConcreteTubes = OrderService.FindConcreteTubesByOrder(orderNumber);
            foreach (var oldConcreteTube in oldConcreteTubes)
            {
                if (tubeGrids.SingleOrDefault<TubeForGrid>(tubeGrid => tubeGrid.ConcreteCode == oldConcreteTube.Code) == null)
                {
                    OrderService.DeleteConcreteTube(oldConcreteTube.Code);
                }
            }

            var oldConcreteIndications = OrderService.FindConcreteIndicationsByOrder(orderNumber);
            foreach (var oldConcreteIndication in oldConcreteIndications)
            {
                if (indicationGrids.SingleOrDefault<IndicationForGrid>(indicationGrid => indicationGrid.ConcreteCode == oldConcreteIndication.Code) == null)
                {
                    OrderService.DeleteConcreteIndication(oldConcreteIndication.Code);
                }
            }
        }
开发者ID:abonSerg,项目名称:Clinic,代码行数:38,代码来源:NewOrderModel.cs


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