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


C# BindingList.Where方法代码示例

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


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

示例1: SetupViewModel

        public void SetupViewModel(PipeTest current, BindingList<Category> CategoryTypes, IReadOnlyList<PipeTest> pipeTests) 
        {
            this.CategoryTypes = CategoryTypes;
            IList<PipeTest> list = pipeTests.Where(_ => _.IsActive && !String.IsNullOrEmpty( _.Code)).OrderBy(x => x.Code).ToList<PipeTest>();
            RepeatTestCandidates = new BindingList<Domain.Entity.Setup.PipeTest>(list);
            pipeTest = new PipeTest();

            if (current != null)
            {
                pipeTest.CustomShallowCopy(current);
                if (current.Id != Guid.Empty)
                {
                    PipeTest curr = RepeatTestCandidates.Where(s => s.Id == pipeTest.Id).SingleOrDefault();
                    RepeatTestCandidates.Remove(curr);
                }
            }
        }
开发者ID:AleksMorozova,项目名称:prizm,代码行数:17,代码来源:MillInspectionViewModel.cs

示例2: findListModel

 private ListModel findListModel(BindingList<ListModel> listModel, string _idList)
 {
     ObservableCollection<ListModel> filtererd = new ObservableCollection<ListModel>(listModel.Where(t => t.Id == _idList)); ;
     return filtererd[0];
 }
开发者ID:death-mouse,项目名称:tempTrello,代码行数:5,代码来源:TrelloViewModel.cs

示例3: findCardModel

 private CardModel findCardModel(BindingList<CardModel> cardModel, string _idCard)
 {
     ObservableCollection<CardModel> filtererd = new ObservableCollection<CardModel>(cardModel.Where(t => t.Id == _idCard)); ;
     return filtererd[0];
 }
开发者ID:death-mouse,项目名称:tempTrello,代码行数:5,代码来源:TrelloViewModel.cs

示例4: findBoardModel

 private BoardModel findBoardModel(BindingList<BoardModel> boardModel, string _idBoard)
 {
     ObservableCollection<BoardModel> filtererd = new ObservableCollection<tempTrello.Model.BoardModel>(boardModel.Where(t => t.Id == _idBoard)); ;
     return filtererd[0];
 }
开发者ID:death-mouse,项目名称:tempTrello,代码行数:5,代码来源:TrelloViewModel.cs

示例5: TextboxUpdate

 private void TextboxUpdate(object sender, EventArgs e, ListBox lb, TextBox tb, BindingList<string> lst)
 {
     if (tb.Text != String.Empty)
     {
         IEnumerable<string> filtered = lst.Where((i) => i.IndexOf(tb.Text, StringComparison.OrdinalIgnoreCase) >= 0);
         if (filtered.Count<string>() != 0)
         {
             lb.DataSource = new BindingSource(filtered, "");
         }
         else
         {
             lb.DataSource = null;
         }
     }
     else
     {
         lb.DataSource = lst;
     }
 }
开发者ID:sshishov,项目名称:CSMDevHelper,代码行数:19,代码来源:frmCSMDH.cs

示例6: CheckForConstrains

        public string CheckForConstrains(BindingList<SpecimenForGrid> specimenGrids, BindingList<TubeForGrid> tubeGrids, BindingList<TestForGrid> testGrids, BindingList<IndicationForGrid> indicationGrids)
        {
            if (!(specimenGrids.Count == 0) && !(tubeGrids.Count == 0) && !(tubeGrids.Count == 0))
            {
                int errorTestGridCount = testGrids.Where(testGrid => string.IsNullOrEmpty(testGrid.Code))
                                                  .Count();

                int errorTubeGridCount = tubeGrids.Where(tubeGrid => string.IsNullOrEmpty(tubeGrid.Code) || string.IsNullOrEmpty(tubeGrid.Tests))
                                                  .Count();

                int errorSpecimenGridCount = specimenGrids.Where(specimenGrid => string.IsNullOrEmpty(specimenGrid.Code) || specimenGrid.Volume < 1 || string.IsNullOrEmpty(specimenGrid.Tubes))
                                                          .Count();
                int errorIndicationGridCount = indicationGrids.Where(indicationGrid => string.IsNullOrEmpty(indicationGrid.Code))
                                                              .Count();

                if ((errorTestGridCount == 0) && (errorTubeGridCount == 0) && (errorSpecimenGridCount == 0) && (errorIndicationGridCount == 0))
                {
                    bool breakFlag = false;
                    string returnValue = string.Empty;
                    foreach (var specimenGrid in specimenGrids)
                    {
                        string[] tubesId = new string[0];
                        if (!breakFlag)
                        {
                            string tubesString = specimenGrid.Tubes;
                            tubesId = tubesString.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
                        }
                        else
                        {
                            return returnValue;
                        }

                        foreach (var tubeId in tubesId)
                        {
                            var dtoSpecimenTubeAttach = new DtoSpecimenTubeAttach()
                            {
                                ConcreteSpecimen = new DtoConcreteSpecimen()
                                {
                                    CollectedDt = specimenGrid.CollectedDt,
                                    Volume = specimenGrid.Volume,
                                },

                                ConcreteTube = new DtoConcreteTube()
                                {
                                    ReceivedDt = tubeGrids.SingleOrDefault<TubeForGrid>(tube => tube.Id == tubeId).ReceivedDt,
                                    Tube = new DtoTube2()
                                    {
                                        Volume = new TubeServiceClient().GetTubeByCode(tubeGrids.Single<TubeForGrid>(tube => tube.Id == tubeId).Code).Volume
                                    }
                                }
                            };
                            if (dtoSpecimenTubeAttach.ConcreteTube.ReceivedDt > dtoSpecimenTubeAttach.ConcreteSpecimen.CollectedDt ||
                                (dtoSpecimenTubeAttach.ConcreteTube.ReceivedDt > DateTime.Now) ||
                                (dtoSpecimenTubeAttach.ConcreteSpecimen.CollectedDt > DateTime.Now))
                            {
                                breakFlag = true;
                                returnValue = "Invalid Date!";
                                break;
                            }
                            else if (dtoSpecimenTubeAttach.ConcreteTube.Tube.Volume < dtoSpecimenTubeAttach.ConcreteSpecimen.Volume)
                            {
                                breakFlag = true;
                                returnValue = "Invalid Specimen Volume!";
                                break;
                            }
                            else
                            {
                                returnValue = string.Empty;
                            }
                        }
                    }
                    return returnValue;

                }
                else
                {
                    return "Check validity of grids!";
                }
            }
            else
            {
                return "Fill all mandatory grids!";
            }
        }
开发者ID:abonSerg,项目名称:Clinic,代码行数:84,代码来源:NewOrderModel.cs

示例7: ConstructFilter

 private BindingList<ItemInfo> ConstructFilter()
 {
     if (this.source == null)
         return null;
     BindingList<ItemInfo> new_binding = new BindingList<ItemInfo>(this.source.Where(info => string.IsNullOrWhiteSpace(info.RequiredChampion)).ToList<ItemInfo>());
     if (!this.chkdlistFilter.GetItemChecked(this.chkdlistFilter.Items.IndexOf("Consumables")))
     {
         new_binding = new BindingList<ItemInfo>(new_binding.Where(info => !info.Consumable).ToList<ItemInfo>());
     }
     if (!this.chkdlistFilter.GetItemChecked(this.chkdlistFilter.Items.IndexOf("Non-Consumables")))
     {
         new_binding = new BindingList<ItemInfo>(new_binding.Where(info => info.Consumable).ToList<ItemInfo>());
     }
     if (!this.chkdlistFilter.GetItemChecked(this.chkdlistFilter.Items.IndexOf("Howling Abyss")))
     {
     }
     if (!this.chkdlistFilter.GetItemChecked(this.chkdlistFilter.Items.IndexOf("Summoner's Rift")))
     {
     }
     if (!this.chkdlistFilter.GetItemChecked(this.chkdlistFilter.Items.IndexOf("Twisted Treeline")))
     {
     }
     return new_binding;
 }
开发者ID:Thespark123,项目名称:RitoPls,代码行数:24,代码来源:formItems.cs

示例8: LoadRecord

        /// <summary>
        /// 載入資料
        /// </summary>
        /// <param name="bindingList"></param>
        public void LoadRecord(BindingList<GeoDataGridViewModel> bindingList)
        {
            this.Clear();

            //重建擺正資訊
            reInitSkew(bindingList);

            //把資料全部加入
            foreach (var geoModel in bindingList)
            {
                if (geoModel.ROIModel != null)
                {
                    //重建且重計算所有的 ROI
                    this._DataList.Add(geoModel);
                    var reloadROI = geoModel.ROIModel.MakeROI();
                    reloadROI.ROIMeasureType = geoModel.GeoType;

                    addTreeNode(reloadROI, geoModel);
                    notifyRecordChanged(GeoDataGridViewNotifyType.ReloadData, reloadROI);
                }
                else
                {
                    //加入舊的非 ROI 的資料列
                    addMeasuredViewModel(geoModel);

                    //更新skew
                    var skewValue = getSkew(_currentSkewID);
                    geoModel.SkewID = _currentSkewID;
                    geoModel.Skew = skewValue;
                }
            }
            //取得所有的 Record, 並更新其相依的資料列
            foreach (var item in _DataList)
            {
                updateDependGeoObject(item);
            }

            //Restore 參考座標
            var coordinateIDs = bindingList.Where(p => !String.IsNullOrEmpty(p.CoordinateID))
                .Select(p => new RefCoordinate()
                {
                    ID = p.CoordinateID,
                    Name = p.CoordinateName,
                    Desc = "",
                }).Distinct().ToList();

            //Clear	Coordinate, 保留 Default
            while (_refCoordinate.Count > 1)
            {
                _refCoordinate.RemoveAt(1);
            }
            foreach (var item in coordinateIDs)
            {
                _refCoordinate.Add(item);
            }
            this.Refresh();
        }
开发者ID:Joncash,项目名称:HanboAOMClassLibrary,代码行数:61,代码来源:GeoDataGridViewManager.cs

示例9: reInitSkew

 /// <summary>
 /// <para>****************</para>
 /// 重建擺正資訊, 只有一個
 /// <para>****************</para>
 /// </summary>
 /// <param name="bindingList"></param>
 private void reInitSkew(BindingList<GeoDataGridViewModel> bindingList)
 {
     //Restore 參考擺正, 只留一個
     var skewIDs = bindingList.Where(p => !String.IsNullOrEmpty(p.SkewID))
         .Select(p => new RefSkew()
         {
             ID = p.SkewID,
             Name = p.SkewName,
             Desc = "",
         }).FirstOrDefault();
     if (skewIDs != null)
     {
         _refSkew.Clear();
         _refSkew.Add(skewIDs);
         _currentSkewID = _refSkew[0].ID;
     }
 }
开发者ID:Joncash,项目名称:HanboAOMClassLibrary,代码行数:23,代码来源:GeoDataGridViewManager.cs

示例10: CalcBuyingPrice

        /// <summary>
        /// Kurzovy prepocet, nakupna cena s dopravou..
        /// </summary>
        internal void CalcBuyingPrice(BindingList<StockItem> items)
        {
            if (items == null)
                return;

            var actualFile = string.Empty;

            foreach (var item in items.Where(i => i.FromFile != null))
            {
                var deliverySum = item.FromFile.Delivery;   // suma dopravy
                var prods = items.Where(i => i.FromFile == item.FromFile);  // vsetky produkty s jedneho MSG suboru
                int prodCount = 0;
                foreach (var prod in prods)
                {
                    prodCount += prod.Disp_Qty;
                }
                double deliveryPricePerItem = deliverySum / prodCount;

                if (item.Description != deliveryText)
                    item.PriceWithDelivery = Math.Round(item.Total + item.Disp_Qty * deliveryPricePerItem, 2);
                else
                    item.PriceWithDelivery = item.Total;

                if (item.OrderDate.Year == 1)
                    item.OrderDate = DateTime.Now;

                if (item.FromFile.FileName != actualFile)
                {
                    log("recalculating delivery for '" + item.FromFile.FileName + "':");
                    log("\tdelivery sum = " + deliverySum);
                    log("\tall products count = " + prodCount);
                    log("\tdelivery price per product = " + Math.Round(deliveryPricePerItem, 2));

                    actualFile = item.FromFile.FileName;
                }
            }
        }
开发者ID:mkoscak,项目名称:active-mizu,代码行数:40,代码来源:MainWindow.cs


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