当前位置:网站首页>对复杂字典Dictionary<T1,T2>排序问题
对复杂字典Dictionary<T1,T2>排序问题
2022-04-23 06:27:00 【大可山人】

//VoltageCount类(电压值对应的数量):
public class VoltageCount
{
public Double Voltage { get; set; } //电压值
public int CountV { get; set; } //电压值对应的数量
public VoltageCount()
{
}
public VoltageCount(Double voltage, int countV)
{
this.Voltage = voltage;
this.CountV = countV;
}
}
Dictionary<Point, VoltageCount>是将坐标点(绘制图像时使用)与VoltageCount数据对应的字典,目的用来在绘图对象(Graphics)中绘制电压值-数量的对应图像(如图中右侧部分)。
由于同时需要按数量大小进行排序,以便输出表格(如图中左边两表格,分别按数量降序排列),所以这里涉及字典排序问题。
Dictionary<Point, VoltageCount> result = new Dictionary<Point, VoltageCount>();
for (int i = 0; i <= 4; i++){
result.Add(listHeatPoints[i], dictionaryPointVoltageCount[listHeatPoints[i]]);
}
//排序
.ToDictionary(pair => pair.Key, pair => pair.Value);
版权声明
本文为[大可山人]所创,转载请带上原文链接,感谢
https://blog.csdn.net/johnsuna/article/details/75098376
边栏推荐
- SAP DEBUG调试FOR IN、REDUCE等复杂的语句
- Hot change scheme and dynamic update strategy of mobile game
- SAP PI/PO功能运行状态监控检查
- Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
- js之自定义属性以及H5中如何判断自定义属性
- [Ted series] how to get along with inner critics?
- SAP PI/PO rfc2Soap 发布rfc接口为ws示例
- MySQL storage engine
- promise all的实现
- Authorization+Token+JWT
猜你喜欢
随机推荐
Understanding of STL container
Reflection on the systematic design of Android audio and video caching mechanism
驼峰命名对像
SAP Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃。
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
3. Sort statement
Authorization+Token+JWT
11.表和库的管理
‘npm‘不是内部或外部命令,也不是可运行的程序 或批处理文件
Hot change scheme and dynamic update strategy of mobile game
C# 多个矩形围成的多边形标注位置的问题
SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
ogldev-读书笔记
学会使用搜索引擎
页面实时显示当前时间
FSM finite state machine
SAP PI/PO rfc2RESTful 发布rfc接口为RESTful示例(Proxy间接法)
Implementation of MySQL persistence
反思 | Android 音视频缓存机制的系统性设计
SAP 03-AMDP CDS Table Function using ‘WITH‘ Clause(Join子查询内容)









