using AntdUI; using DH.Commons.Base; 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 DHSoftware.Views { public partial class CameraConfigControl : UserControl { public CameraConfigControl() { InitializeComponent(); // InitTableColumns(); InitData(); } AntList antList = null; CameraBase curUser; //private void InitTableColumns() //{ // table_base.Columns = new ColumnCollection() { // new ColumnCheck("Selected"){Fixed = true}, // new Column("CameraName", "相机名", ColumnAlign.Center) // { // Width="120", // //设置树节点,名称需和User里的User[]名称保持一致 // KeyTree = "Users" // }, // new Column("CameraIP", "相机IP",ColumnAlign.Center), // new Column("Gain", "增益"){ // Width = "120", // LineBreak = true, // }, // new ColumnSwitch("IsHardwareTrigger", "硬触发", ColumnAlign.Center){ // }, // new Column("RotateImage", "旋转",ColumnAlign.Center), // new Column("Exposure", "曝光",ColumnAlign.Center), // //new Column("CellBadge", "徽标",ColumnAlign.Center), // //new Column("CellText", "富文本") // //{ // // ColAlign = ColumnAlign.Center,//支持表头位置单独设置 // //}, // //new Column("CellProgress", "进度条",ColumnAlign.Center), // //new Column("CellDivider", "分割线",ColumnAlign.Center), // //new Column("CellLinks", "链接", ColumnAlign.Center) // //{ // // Fixed = true,//冻结列 // //}, // }; //} private void InitData() { antList = new AntList(); for (int i = 0; i < 10; i++) { antList.Add(new CameraBase { CameraName = "相机1", CameraIP = "", Gain = 6, IsHardwareTrigger = true, RotateImage = 50, Exposure = 100, //CellLinks = new CellLink[] {new CellLink("https://gitee.com/antdui/AntdUI", "AntdUI"), //new CellButton(Guid.NewGuid().ToString(),"编辑",TTypeMini.Primary), //new CellButton(Guid.NewGuid().ToString(), "徽标", TTypeMini.Success) //{ // //支持所有单元格控件 // DropDownItems = new ISelectItem[] // { // new AntdUI.SelectItem(TState.Default), // new AntdUI.SelectItem(TState.Primary), // new AntdUI.SelectItem(TState.Success), // new AntdUI.SelectItem(TState.Error), // new AntdUI.SelectItem(TState.Warn), // new AntdUI.SelectItem(TState.Processing), // }, // DropDownValueChanged = (value) => // { // string badge = value.ToString(); // //switch(badge) { // //case "Default": // // curUser.CellBadge = new CellBadge(TState.Default, badge); break; // //case "Primary": // // curUser.CellBadge = new CellBadge(TState.Primary, badge); break; // //case "Success": // // curUser.CellBadge = new CellBadge(TState.Success, badge); break; // //case "Error": // // curUser.CellBadge = new CellBadge(TState.Error, badge); break; // //case "Warn": // // curUser.CellBadge = new CellBadge(TState.Warn, badge); break; // //case "Processing": // // curUser.CellBadge = new CellBadge(TState.Processing, badge); break; // //} // } //}, //new CellButton(Guid.NewGuid().ToString(),"删除",TTypeMini.Error), //new CellButton(Guid.NewGuid().ToString(),"查看图片",TTypeMini.Primary)}, //value:0-1 // CellProgress = new CellProgress(0.5f), // CellDivider = new CellDivider(), }); } //设置树数据,可为任意行设置 // antList[1].Users = subUsers.ToArray(); // table_base.Binding(antList); //设置行禁用 // table_base.SetRowEnable(0, false, true); } } }