本文整理汇总了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);
}
示例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);
}
});
}
示例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();
}
示例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();
}
示例5: SetIndexDetails
public void SetIndexDetails(BindingList<IndexValues> values)
{
gvDetails.DataSource = null;
gvDetails.AutoGenerateColumns = false;
gvDetails.DataSource = values.OrderBy(i=>i.SortIndex).ToList();
}
示例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);
}