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


C# ObservableCollection.Min方法代码示例

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


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

示例1: RangeCollection

 public RangeCollection() 
 {
     _ranges = new ObservableCollection<IRange>();
     _ranges.CollectionChanged += (s, e) =>
     {
         switch (e.Action)
         {
             case NotifyCollectionChangedAction.Add:
                 foreach (IRange newRange in e.NewItems)
                 {
                     AddInternal(newRange);
                     newRange.RangeChanged += CollectionElementChanged;
                 }
                 break;
             case NotifyCollectionChangedAction.Remove:
                 var isRescanNeeded = false;
                 foreach (Range oldRange in e.OldItems)
                 {
                     oldRange.RangeChanged -= CollectionElementChanged;
                     isRescanNeeded = (oldRange.Max >= Maximum) || (oldRange.Min <= Minimum);
                 }
                 if (isRescanNeeded) Update(_ranges.Min(r => r.Min), _ranges.Max(r => r.Max));
                 break;
         }
     };
 }
开发者ID:AuditoryBiophysicsLab,项目名称:ESME-Workbench,代码行数:26,代码来源:RangeCollection.cs

示例2: GetLeftFromChildren

 private double GetLeftFromChildren(ObservableCollection<ICanvasItem> children)
 {
     if (!children.Any())
     {
         return double.NaN;
     }
     var min = children.Min(item => item.Left);
     return min;
 }
开发者ID:modulexcite,项目名称:VisualDesigner,代码行数:9,代码来源:ChildrenExpandableCanvasItem.cs

示例3: GetCurrentLocation

        private static Point GetCurrentLocation(ObservableCollection<IDesignable> observableCollection)
        {
            if (observableCollection.Count == 0)
                return new Point(0, 0);

            var minLeft = observableCollection.Min(designable => designable.Left);
            var minTop = observableCollection.Min(designable => designable.Top);
            return new Point(minLeft, minTop);
        }
开发者ID:SuperJMN,项目名称:Glass,代码行数:9,代码来源:DesignableGroup.cs

示例4: LoadReport

        private void LoadReport()
        {
            var query = from s in ServiceZipList
                        where StoresWithCheckList.Where(st => st.Check).Any(st => st.Store.StoreNumber == s.StoreNumber) &&
                              ReturnNumberMonth(s.ServiceMonth) >= ReturnNumberMonth(StartMonth) &&
                              ReturnNumberMonth(s.ServiceMonth) <= ReturnNumberMonth(EndMonth) &&
                              s.ServiceYear >= StartYear &&
                              s.ServiceYear <= EndYear
                        select s;
            ReportStoresCount = StoresWithCheckList.Where(st => st.Check).Count();
            WorkICL = query.Where(q => q.Company == "АйСиЭл").Where(q => q.ZipName == "Ремонт").Sum(q => q.ZipQuantity.Value == 0 ? q.ZipPrice : q.ZipQuantity.Value * q.ZipPrice);
            EquipmentICL = query.Where(q => q.Company == "АйСиЭл").Where(q => q.ZipName != "Транспортные услуги" && q.ZipName != "Ремонт").Sum(q => q.ZipQuantity.Value == 0 ? q.ZipPrice : q.ZipQuantity.Value * q.ZipPrice);
            TrICL = query.Where(q => q.Company == "АйСиЭл").Where(q => q.ZipName == "Транспортные услуги").Sum(q => q.ZipQuantity.Value == 0 ? q.ZipPrice : q.ZipQuantity.Value * q.ZipPrice);
            TotalICL = WorkICL + EquipmentICL + TrICL;
            AvICL = TotalICL / StoresWithCheckList.Where(st => st.Check).Count();
            WorkKKS = query.Where(q => q.Company == "ККС").Where(q => q.ZipName == "Ремонт").Sum(q => q.ZipQuantity.Value == 0 ? q.ZipPrice : q.ZipQuantity.Value * q.ZipPrice);
            EquipmentKKS = query.Where(q => q.Company == "ККС").Where(q => q.ZipName != "Транспортные услуги" && q.ZipName != "Ремонт").Sum(q => q.ZipQuantity.Value == 0 ? q.ZipPrice : q.ZipQuantity.Value * q.ZipPrice);
            TrKKS = query.Where(q => q.Company == "ККС").Where(q => q.ZipName == "Транспортные услуги").Sum(q => q.ZipQuantity.Value == 0 ? q.ZipPrice : q.ZipQuantity.Value * q.ZipPrice);
            TotalKKS = WorkKKS + EquipmentKKS + TrKKS;
            AvKKS = TotalKKS / StoresWithCheckList.Where(st => st.Check).Count();
            var list = (from s in query
                        where s.Company == "ККС"
                        group s by new { s.ServiceMonth, s.ServiceYear }
                        into ym
                        select new MonthExp { MonthYear = new DateTime(ym.Key.ServiceYear.Value, ReturnNumberMonth(ym.Key.ServiceMonth), 1), Expense = (ym.Where(s => s.ZipQuantity.Value == 0).Sum(s => s.ZipPrice) + ym.Where(s => s.ZipQuantity.Value != 0).Sum(s => s.ZipPrice * s.ZipQuantity.Value)) }).ToList();
            KKSExpList = new ObservableCollection<MonthExp>(list);
            list = (from s in query
                    where s.Company == "АйСиЭл"
                    group s by new { s.ServiceMonth, s.ServiceYear }
                    into ym
                    select new MonthExp { MonthYear = new DateTime(ym.Key.ServiceYear.Value, ReturnNumberMonth(ym.Key.ServiceMonth), 1), Expense = (ym.Where(s => s.ZipQuantity.Value == 0).Sum(s => s.ZipPrice) + ym.Where(s => s.ZipQuantity.Value != 0).Sum(s => s.ZipPrice * s.ZipQuantity.Value)) }).ToList();
            ICLExpList = new ObservableCollection<MonthExp>(list);
            var minKKS = KKSExpList.Count > 0 ? KKSExpList.Min(k => k.Expense) - 3000 : 0;
            var maxKKS = KKSExpList.Count > 0 ? KKSExpList.Max(k => k.Expense) + 10000 : 100000;
            var minICL = ICLExpList.Count > 0 ? ICLExpList.Min(i => i.Expense) - 3000 : 0;
            var maxICL = ICLExpList.Count > 0 ? ICLExpList.Max(i => i.Expense) + 10000 : 100000;
            MinimumAmount = minKKS > minICL ? minICL : minKKS;
            MaximumAmount = maxKKS > maxICL ? maxKKS : maxICL;

        }
开发者ID:Fredoq,项目名称:AccountsWork,代码行数:40,代码来源:StoresServiceReportViewModel.cs


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