当前位置:网站首页>对复杂字典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
边栏推荐
- 面经总结2
- 异步的学习
- 手游的热更方案与动态更新策略
- State synchronization and frame synchronization
- Thorough inquiry -- understanding and analysis of cocos2d source code
- Moment. Format of format method function in JS
- 判断字符串首尾是否包含目标参数:startsWith()、endsWith()方法
- 7. sub query
- 【自我激励系列】你永远不会准备好
- SAP pi / PO rfc2restful publishing RFC interface is a restful example (proxy indirect method)
猜你喜欢
SAP CR传输请求顺序、依赖检查
How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)
SAP PI/PO Soap2Proxy 消费外部ws示例
Visualization Road (IX) detailed explanation of arrow class
Authorization+Token+JWT
SAP PI/PO rfc2RESTful 发布rfc接口为RESTful示例(Proxy间接法)
简易随机点名抽奖(js下编写)
js之DOM学习获取元素
js之排他思想及案例
Date object (JS built-in object)
随机推荐
SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
SAP PI/PO Soap2Proxy 消费外部ws示例
[Ted series] how does a habit change my life
简单理解==和equals,String为什么可以不用new
C#使用拉依达准则(3σ准则)剔除异常数据(.Net剔除一组数据中的奇异值)
系统与软件安全研究(五)
Judge whether the beginning and end of the string contain target parameters: startswith() and endswith() methods
Super classic & Programming Guide (red and blue book) - Reading Notes
SAP PI/PO功能运行状态监控检查
中间人环境mitmproxy搭建
数组扁平化
SAP PI/PO登录使用及基本功能简介
Design optimization of MySQL database
[self motivation series] you'll never be ready
js之DOM学习获取元素
new的实现
游戏辅助脚本开发之旅
刨根问底---cocos2d源码的理解与分析
Use of typescript dictionary
'NPM' is not an internal or external command, nor is it a runnable program or batch file