Table是怎样炼成的:Column、ColumnCollection

描述数据列的类定义

1ExpandedBlockStart.gifContractedBlock.gif/**////<summary>
2InBlock.gif///描述数据列
3ExpandedBlockEnd.gif///</summary>

4None.gifpublicclassColumn
5ExpandedBlockStart.gifContractedBlock.gifdot.gif{
6InBlock.gif
7InBlock.gif
8InBlock.gifpublicColumn(stringname,Typetype)
9InBlock.gif:this(name,type,null)
10ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
11InBlock.gif
12ExpandedSubBlockEnd.gif}

13InBlock.gif
14InBlock.gifpublicColumn(stringname,Typetype,objectdefaultValue)
15ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
16InBlock.gifColumnName=name;
17InBlock.gifDataType=type;
18InBlock.gifDefaultValue=defaultValue;
19ExpandedSubBlockEnd.gif}

20InBlock.gif
21ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
22InBlock.gif///获取或设置列的名称
23ExpandedSubBlockEnd.gif///</summary>

24InBlock.gifpublicreadonlystringColumnName;
25ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
26InBlock.gif///获取或设置列的数据类型
27ExpandedSubBlockEnd.gif///</summary>

28InBlock.gifpublicreadonlySystem.TypeDataType;
29ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
30InBlock.gif///获取或设置列的默认值
31ExpandedSubBlockEnd.gif///</summary>

32InBlock.gifpublicobjectDefaultValue=null;
33InBlock.gif
34InBlock.gif
35ExpandedBlockEnd.gif}


定义ColumnCollection
1ExpandedBlockStart.gifContractedBlock.gif/**////<summary>
2InBlock.gif///描述或设置列的集合
3ExpandedBlockEnd.gif///</summary>

4None.gifpublicclassColumnCollection:System.Collections.CollectionBase
5ExpandedBlockStart.gifContractedBlock.gifdot.gif{
6ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
7InBlock.gif///设置或获取指定的列
8InBlock.gif///</summary>
9InBlock.gif///<paramname="index"></param>
10ExpandedSubBlockEnd.gif///<returns></returns>

11InBlock.gifpublicColumnthis[intindex]
12ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
13InBlock.gifget
14ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
15InBlock.gifreturn(Column)this.InnerList[index];
16ExpandedSubBlockEnd.gif}

17InBlock.gifset
18ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
19InBlock.gifthis.InnerList[index]=value;
20ExpandedSubBlockEnd.gif}

21ExpandedSubBlockEnd.gif}

22InBlock.gif
23ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
24InBlock.gif///设置或获取指定的列
25InBlock.gif///</summary>
26InBlock.gif///<paramname="index"></param>
27ExpandedSubBlockEnd.gif///<returns></returns>

28InBlock.gifpublicColumnthis[stringcolumnName]
29ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
30InBlock.gifget
31ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
32InBlock.gifreturn(Column)this[this.IndexOf(columnName)];
33ExpandedSubBlockEnd.gif}

34InBlock.gifset
35ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
36InBlock.gifthis[this.IndexOf(columnName)]=value;
37ExpandedSubBlockEnd.gif}

38ExpandedSubBlockEnd.gif}

39InBlock.gif
40InBlock.gifprivateSystem.Collections.ArrayListcolNames=newSystem.Collections.ArrayList();
41InBlock.gif
42ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
43InBlock.gif///添加一个列
44InBlock.gif///</summary>
45ExpandedSubBlockEnd.gif///<paramname="column">列的实例</param>

46InBlock.gifpublicvoidAdd(Columncolumn)
47ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
48InBlock.gifif(!colNames.Contains(column.ColumnName))
49ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
50InBlock.gifthis.InnerList.Add(column);
51InBlock.gifcolNames.Add(column.ColumnName);
52ExpandedSubBlockEnd.gif}

53InBlock.gif
54ExpandedSubBlockEnd.gif}

55InBlock.gif
56ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
57InBlock.gif///添加一个列
58InBlock.gif///</summary>
59InBlock.gif///<paramname="name">列的名称</param>
60ExpandedSubBlockEnd.gif///<paramname="type">列的类型</param>

61InBlock.gifpublicvoidAdd(stringname,Typetype,objectdefaultValue)
62ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
63InBlock.gifthis.Add(newColumn(name,type,defaultValue));
64ExpandedSubBlockEnd.gif}

65InBlock.gif
66ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
67InBlock.gif///返回列的名称是否包含在集合中
68InBlock.gif///</summary>
69InBlock.gif///<paramname="columnName">列的名称</param>
70ExpandedSubBlockEnd.gif///<returns>如果已经包含,则返回true,否则为false</returns>

71InBlock.gifpublicboolContains(stringcolumnName)
72ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
73InBlock.gifreturncolNames.Contains(colNames);
74ExpandedSubBlockEnd.gif}

75InBlock.gif
76ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
77InBlock.gif///返回列的位置
78InBlock.gif///</summary>
79InBlock.gif///<paramname="column">列的实例</param>
80ExpandedSubBlockEnd.gif///<returns>如果没有包含则返回-1,否则从0开始的索引</returns>

81InBlock.gifpublicintIndexOf(Columncolumn)
82ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
83InBlock.gifreturnthis.IndexOf(column.ColumnName);
84ExpandedSubBlockEnd.gif}

85InBlock.gif
86ExpandedSubBlockStart.gifContractedSubBlock.gif/**////<summary>
87InBlock.gif///返回列的位置
88InBlock.gif///</summary>
89InBlock.gif///<paramname="column">列的实例</param>
90ExpandedSubBlockEnd.gif///<returns>如果没有包含则返回-1,否则从0开始的索引</returns>

91InBlock.gifpublicintIndexOf(stringcolumnName)
92ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
93InBlock.gifreturncolNames.IndexOf(columnName);
94ExpandedSubBlockEnd.gif}

95ExpandedBlockEnd.gif}


下一篇,我们终于可以定义Table了
using DLabs.App.Common.Interfaces; using DLabs.App.SOP.Common.API; using DLabs.App.SOP.Common.Models; using DLabs.App.SOP.Models; using DLabs.Core; using DLabs.Core.Attributes; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace DLabs.App.SOP.Forms { public partial class MainForm : Form { [AutoWried] IUserInfo Userinfo; public MainForm() { InitializeComponent(); AddinContext.Contexts.AutoInject(this); //设置列名 tabelGroupInfo.Columns = new AntdUI.ColumnCollection { new AntdUI.Column("Index","序号").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("GroupId","分组编号").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("GroupName","分组名称").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("GroupDate","分组日期").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("SopNo","模板编号").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("SopName","模板名称").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("TaskCondition","任务状态").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("SampleName","样品名称").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), new AntdUI.Column("Action","操作").SetFixed().SetColAlign(AntdUI.ColumnAlign.Center).SetWidth("auto"), }; //设置分组日期的初始值 groupDatePickerRange.Value = new DateTime[] { DateTime.Now.AddDays(-6),DateTime.Now}; } private void MainForm_Load(object sender, EventArgs e) { UpdateDataSource(); } /// <summary> /// 更新数据到界面 /// </summary> /// <param name="TaskLists"></param> public void UpdateDataSource() { List<GroupSummaryInfo> list = RPC_GroupInfo.QuerySummaryInfoES(new GroupSummaryInfoDTO() { staff = Userinfo.userName, //taskCondition = TaskConditionType.TESTING, startTime = this.groupDatePickerRange.Value[0].ToString("yyyy-MM-dd"), endTime = this.groupDatePickerRange.Value[1].ToString("yyyy-MM-dd"), groupName = selectGroupName.Text.Trim(), sopNo = selectTemplateNo.Text.Trim(), sopName = selectTemplateName.Text.Trim() }); var bindList = new BindingList<SOPTaskBindTableEntity>(); foreach (var item in list) { int i = 1; SOPTaskBindTableEntity entity = new SOPTaskBindTableEntity(); entity.Index = i; entity.GroupId = item.groupId; entity.GroupName = item.groupName; entity.GroupDate = item.groupDate; entity.SopNo = item.sopNo; entity.SopName= item.sopName; entity.TaskCondition = item.taskCondition; entity.SampleName = item.sampleName; bindList.Add(entity); } tabelGroupInfo.Binding(bindList); } } } 这是我的代码,我现在有一个tabelPagination,我需要对查询出来的数据进行分页,该如何实现
11-07
考虑可再生能源出力不确定性的商业园区用户需求响应策略(Matlab代码实现)内容概要:本文围绕“考虑可再生能源出力不确定性的商业园区用户需求响应策略”展开,结合Matlab代码实现,研究在可再生能源(如风电、光伏)出力具有不确定性的背景下,商业园区如何制定有效的需求响应策略以优化能源调度和提升系统经济性。文中可能涉及不确定性建模(如场景生成与缩减)、优化模型构建(如随机规划、鲁棒优化)以及需求响应机制设计(如价格型、激励型),并通过Matlab仿真验证所提策略的有效性。此外,文档还列举了大量相关的电力系统、综合能源系统优化调度案例与代码资源,涵盖微电网调度、储能配置、负荷预测等多个方向,形成一个完整的科研支持体系。; 适合人群:具备一定电力系统、优化理论和Matlab编程基础的研究生、科研人员及从事能源系统规划与运行的工程技术人员。; 使用场景及目标:①学习如何建模可再生能源的不确定性并应用于需求响应优化;②掌握使用Matlab进行商业园区能源系统仿真与优化调度的方法;③复现论文结果或开展相关课题研究,提升科研效率与创新能力。; 阅读建议:建议结合文中提供的Matlab代码实例,逐步理解模型构建与求解过程,重点关注不确定性处理方法与需求响应机制的设计逻辑,同时可参考文档中列出的其他资源进行扩展学习与交叉验证。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值