当前位置:网站首页>对复杂字典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
边栏推荐
- 5.SQL99标准:内连接和外连接
- ogldev-读书笔记
- 'NPM' is not an internal or external command, nor is it a runnable program or batch file
- Redis connection error err auth < password > called without any password configured for the default user
- Judge whether the beginning and end of the string contain target parameters: startswith() and endswith() methods
- SAP Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃。
- 移动端布局(3D转换、动画)
- MySQL storage engine
- CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
- Authorization server (simple construction of authorization server)
猜你喜欢

js之排他思想及案例

js之DOM事件

SAP 导出Excel文件打开显示:“xxx“的文件格式和扩展名不匹配。文件可能已损坏或不安全。除非您信任其来源,否则请勿打开。是否仍要打开它?

Custom time format (yyyy-mm-dd HH: mm: SS week x)

ABAP CDS VIEW WITH ASSOCIATION示例

js之什么是事件?事件三要素以及操作元素

Django使用mysql数据库报错解决

redis连接出错 ERR AUTH <password> called without any password configured for the default user.

Design optimization of MySQL database

王者荣耀-unity学习之旅
随机推荐
系统与软件安全研究(三)
简易随机点名抽奖(js下编写)
手游的热更方案与动态更新策略
斐波拉去动态规划
Reflection on the systematic design of Android audio and video caching mechanism
State synchronization and frame synchronization
14. Transaction processing
3. Sort statement
ABAP 从CDS VIEW 发布OData Service示例
页面动态显示时间(升级版)
基于NLP的软件安全研究(一)
【自我激励系列】你永远不会准备好
层次输出二叉树
将单行文字自动适应到目标矩形框内
刨根问底---cocos2d源码的理解与分析
驼峰命名对像
基于NLP的软件安全研究(二)
页面实时显示当前时间
Common DOS commands
Implementation of MySQL persistence