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


C# BindingList.OrderBy方法代码示例

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


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

示例1: Create

    internal void Create(BindingList<CurveReconciler.CompareItem> items_)
    {
      var grid = new BoundInfraGrid();
      grid.Bind(items_);
      grid.Dock=DockStyle.Fill;
      this.splitContainer1.Panel1.Controls.Add(grid);

      var chart = new SimpleWtsColumnChart();
      var sorted = items_.OrderBy(x => x.FIID);

      var headings = sorted.Select(x => x.SymmetryCode.Split(' ')[0]).ToArray();
      var values = sorted.Select(x => (x.DiffAsBps.HasValue) ? x.DiffAsBps.Value : 0d).ToArray();

      chart.SetYAxisFormat("##0.000#");
      chart.Dock = DockStyle.Fill;
      chart.Create(headings, values);
      this.splitContainer1.Panel2.Controls.Add(chart);
    }
开发者ID:heimanhon,项目名称:researchwork,代码行数:18,代码来源:CurveCompareControl.cs

示例2: DisplayTasks

        public void DisplayTasks(IList<TaskViewModel> tasks, String[] taskTypes, String[] taskCategories)
        {
            this.tasks = tasks == null ? null : new SortableBindingList<TaskViewModel>(tasks);
            this.InvokeIfRequired(() =>
            {
                this.textBoxName.Enabled = false;
                this.comboBoxType.Enabled = false;
                this.comboBoxCategory.Enabled = false;

                this.comboBoxType.Items.Clear();
                if (taskTypes != null)
                {
                    this.comboBoxType.Items.AddRange(taskTypes);
                }

                this.comboBoxCategory.Items.Clear();
                if (taskCategories != null)
                {
                    this.comboBoxCategory.Items.AddRange(taskCategories);
                }

                if (tasks == null)
                {
                    this.taskViewModelBindingSource.DataSource = new SortableBindingList<TaskViewModel>();
                    this.taskViewModelBindingSource.ResetBindings(false);
                }
                else
                {
                    var ordered = tasks.OrderBy(x => x.OrderId);
                    int cpt = 0;
                    foreach (var item in ordered)
                    {
                        item.OrderId = cpt;
                        cpt++;
                    }
                    this.taskViewModelBindingSource.DataSource = this.tasks;
                    this.taskViewModelBindingSource.Sort = "OrderId ASC";
                    this.taskViewModelBindingSource.ResetBindings(false);
                }
            });
        }
开发者ID:grozeille,项目名称:chiffrage,代码行数:41,代码来源:TasksUserControl.cs

示例3: GetData

        private void GetData()
        {
            LawDictionaryModels = new BindingList<LawDictionaryModel>();

            // Read the file contents back into a variable.
            try
            {
                LawDictionaryModels =
                    BinaryFileHelper.ReadFromBinaryFile<IList<LawDictionaryModel>>(dir + "MyLDData.dll");

                
            }
            catch
            {
            }

            var roleKey = "";

            try
            {
                roleKey = BinaryFileHelper.ReadFromBinaryFile<string>(dir + "RoleKey.dll");
            }
            catch
            {
            }


            if (roleKey.Equals(RoleKey))
            {
                IsAdmin = true;
            }

            Types =
                new BindingList<string>(
                    LawDictionaryModels.OrderBy(s => s.OrderType).Select(s => s.Type).Distinct().ToList());
            Years =
                new BindingList<string>(
                    LawDictionaryModels.OrderByDescending(s => s.Year).Select(s => s.Year).Distinct().ToList());
            NGOs =
                new BindingList<string>(LawDictionaryModels.OrderBy(s => s.NGO).Select(s => s.NGO).Distinct().ToList());

            BindButtons();
            BindType();
            BindYear();
            BindNGO();

            Search();
        }
开发者ID:konzuk,项目名称:LoanProjectSQL,代码行数:48,代码来源:MainForm.cs

示例4: DoProcesses

        private void DoProcesses(BindingList<Process> _processes)
        {
            while (programIsRunning || _processes.Count > 0)
            {
                if (_processes.Count > 0)
                {
                    mut.WaitOne();
                    List<Process> sortedProcesses = _processes.OrderBy(x => x.Priority).ToList();
                    mut.ReleaseMutex();
                    sortedProcesses[0].Execute();
                    this.Invoke((Action) (() =>
                    {
                        results.First(x => x.ProcessId == sortedProcesses[0].Id).PauseTime =
                            sortedProcesses[0].GetPauseTime();
                        results.First(x => x.ProcessId == sortedProcesses[0].Id).EndTime = watch.ElapsedMilliseconds;
                        _processes.Remove(_processes.First(x => x.Id == sortedProcesses[0].Id));
                        dataGridViewResults.Refresh();
                    }));
                }
                else
                {
                    Thread.Sleep(10);
                    processorFreeTime += 10;
                }

            }
            ActionsAfterProgramStops();
        }
开发者ID:TkachenkoRoman,项目名称:SPO_lab3_processor_planning,代码行数:28,代码来源:Form1.cs

示例5: SetIndexDetails

 public void SetIndexDetails(BindingList<IndexValues> values)
 {
     gvDetails.DataSource = null;
     gvDetails.AutoGenerateColumns = false;
     gvDetails.DataSource = values.OrderBy(i=>i.SortIndex).ToList();
 }
开发者ID:Winsor,项目名称:ITInfra,代码行数:6,代码来源:EventIndexDetail.cs

示例6: CreateCopyProcessIOrderedEnumerable

 private IOrderedEnumerable<Process> CreateCopyProcessIOrderedEnumerable(BindingList<Process> list)
 {
     BindingList<Process> result = new BindingList<Process>();
     foreach (Process process in list)
     {
         Process current = new Process(process.Id, process.ArrivalTime, process.ExecutionTime);
         result.Add(current);
     }
     return result.OrderBy(p => p.ArrivalTime);
 }
开发者ID:TkachenkoRoman,项目名称:ProcessorPlanning,代码行数:10,代码来源:Form1.cs


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