当前位置:网站首页>对复杂字典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 PI/PO rfc2Soap 发布rfc接口为ws示例
- 反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
- SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
- 设置了body的最大宽度,但是为什么body的背景颜色还铺满整个页面?
- keytool: command not found
- What are the total number of all courses of Mr. Tang Xiaoyang, who is very popular in CSDN (question mark)
- ABAP 7.4 SQL Window Expression
- SAP ECC连接SAP PI系统配置
- Date object (JS built-in object)
- 将单行文字自动适应到目标矩形框内
猜你喜欢
随机推荐
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
页面实时显示当前时间
SAP pi / PO rfc2restful publishing RFC interface is a restful example (proxy indirect method)
FSM finite state machine
3. Sort statement
ABAP 实现发布RESTful服务供外部调用示例
利用Lambda表达式解决c#文件名排序问题(是100大还是11大的问题)
驼峰命名对像
对js中argumens的简单理解
Methods of database query optimization
typescript字典的使用
SAP PI/PO rfc2Soap 发布rfc接口为ws示例
2. Restricted query
游戏辅助脚本开发之旅
数组扁平化
[Ted series] how does a habit change my life
Preliminary configuration of OpenGL super Dictionary (freeglut, glew, gltools, GLUT)
MySQL storage engine
ABAP CDS VIEW WITH ASSOCIATION示例
MySQL index









