protected virtual void InitDevicesGridView(GridView grdView) { grdView.Columns.Clear(); //设备ID var colNo = ControlUtilityTool.AddGridViewColum(grdView, IS_SELECT, DEV_ID_ALIAS); colNo.OptionsColumn.AllowEdit = true; colNo.Width = 100; colNo.OptionsColumn.FixedWidth = true; var chkedt = this.GetRepositoryCheckEdit(grdView); chkedt.GlyphAlignment = HorzAlignment.Near; colNo.ColumnEdit = chkedt; colNo.ShowButtonMode = ShowButtonModeEnum.ShowAlways; //设备MAC地址 this.AddOneGridViewColumn(grdView, DEV_MAC, DEV_MAC_ALIAS, 150); //设备IP地址 this.AddOneGridViewColumn(grdView, DEV_IP, DEV_IP_ALIAS, 120); //子网掩码 this.AddOneGridViewColumn(grdView, SUBNET_MARK, SUBNET_MARK_ALIAS, 120); //网关 this.AddOneGridViewColumn(grdView, GATE_WAY, GATE_WAY_ALIAS, 120); }
private void rgpPsd_SelectedIndexChanged(object sender, EventArgs e) { switch (this.rgpPsd.SelectedIndex) { case 0: { this.edtPsd.Visible = false; this.btnOK.Text = "登 录"; } break; case 1: { this.edtPsd.Text = string.Empty; //this.edtPsd.Text = KeyMacOperate.GetMacEx("0100C0A87BD1FFFFFF00C0A87BFED3A24E01000000001A0AEB2A00000126"); this.edtPsd.Visible = true; this.btnOK.Text = "保 存"; ControlUtilityTool.SetFocus(this.edtPsd); } break; default: break; } }
protected override void InitUIOnShown() { HintProvider.WaitingDone(Application.ProductName); base.InitUIOnShown(); this.pnlButtom.Visible = false; this.btnMin.Visible = true; ControlUtilityTool.SetControlDefaultFont(this.lblCaption, 15, FontStyle.Bold); //this.lblCaption.Text = "网络设备参数设置工具"; string strVersion = string.Format("V{0}", StrUtils.GetFileVersion(Path.Combine(Application.StartupPath, "ParamsSettingTool.exe"))); title = "网络设备参数设置工具" + "(" + strVersion + ")"; this.lblCaption.Text = title; f_UserControls = new Dictionary <string, GeneralUserControl>(); //启动Udp监听 int udpPort = StrUtils.StrToIntDef(AppXmlConfig.Singleton[AppXmlConfig.UDP_SOURCE_PORT].ToString(), AppConst.UDP_SOURCE_PORT); f_UdpListener = new UdpListener(udpPort); string errMsg = string.Empty; if (!f_UdpListener.StartUdp(ref errMsg)) { HintProvider.ShowAutoCloseDialog(this, string.Format("启动Udp监听失败,错误:{0}", errMsg)); } AppXmlConfig.Singleton.Save(); //暂时无云对讲设备 this.nbItemCloudIntercom.Visible = false; }
protected override void InitUIOnLoad() { base.InitUIOnLoad(); ControlUtilityTool.SetITLGridViewStyle(this.gvDevices, true); ControlUtilityTool.SetControlDefaultColor(this.pnlOperateArea, ControlUtilityTool.PubBackColorNormal); gvDevices.OptionsBehavior.Editable = true; //不允许对单元格进行编辑 this.InitDevicesDataTable(); this.InitDevicesGridView(this.gvDevices); }
protected override void InitUIOnShown() { base.InitUIOnShown(); ControlUtilityTool.SetITLTextEditStyle(this.edtPath); this.ReadXMLConfig(); this.RefreshUIByConfig(); ControlUtilityTool.SetFocus(this.edtPath); }
protected GridColumn AddOneGridViewColumn(GridView grdView, string fieldName, string caption, int columnWidth) { GridColumn oneColumn = ControlUtilityTool.AddGridViewColum(grdView, fieldName, caption); oneColumn.OptionsColumn.AllowFocus = false; //去掉焦点 oneColumn.Width = columnWidth; oneColumn.OptionsColumn.FixedWidth = true; oneColumn.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; oneColumn.AppearanceCell.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; return(oneColumn); }
protected override void InitUIOnLoad() { base.InitUIOnLoad(); ControlUtilityTool.SetPanelControlBorderLines(this.pnlContainer, true, true, true, true); ControlUtilityTool.SetITLLayOutControlStyle(this.lcItem); ControlUtilityTool.SetITLTextEditStyle(this.edtDevIp); ControlUtilityTool.SetTextEditIPRegEx(this.edtDevIp); ControlUtilityTool.SetITLComboBoxEditStyle(this.cmbCtrlProperties); this.edtDevIp.Properties.MaxLength = 15; this.edtDevIp.KeyPress += CommonUtils.edtIp_KeyPress; this.InitDevPropCmbEdit(); }
protected override void InitUIOnShown() { HintProvider.WaitingDone(Application.ProductName); base.InitUIOnShown(); ControlUtilityTool.SetITLTextEditStyle(this.edtPsd); ControlUtilityTool.SetSuperToolTip(this.edtPsd, "密码必须由8位纯数字组成!"); this.rgpPsd.SelectedIndex = 1; this.edtPsd.Properties.MaxLength = 8; this.edtPsd.KeyPress += CommonUtils.edtPort_KeyPress; //只能输入整形 ControlUtilityTool.SetFocus(this.edtPsd); char a = '*'; List <char> lisrt = new List <char>(); lisrt.Add(a); //指定密码框样式 this.edtPsd.Properties.PasswordChar = lisrt[0];//采用的样式 }
private void GeneralForm_SizeChanged(object sender, EventArgs e) { //变更最大化按钮图标 if (this.WindowState == FormWindowState.Normal) { this.btnMax.Image = ParamsSettingTool.Properties.Resources.Max_16; if (!UtilityTool.IsDesignMode()) { ControlUtilityTool.SetSuperToolTip(this.btnMax, "最大化"); } } else if (this.WindowState == FormWindowState.Maximized) { this.btnMax.Image = ParamsSettingTool.Properties.Resources.MaxEx_16; if (!UtilityTool.IsDesignMode()) { ControlUtilityTool.SetSuperToolTip(this.btnMax, "还原"); } } //调整标题位置 this.SetCaptionPosition(); }
protected override void InitDevicesGridView(GridView grdView) { base.InitDevicesGridView(grdView); //云电梯UDP端口 this.AddOneGridViewColumn(grdView, CLOUD_ELEVATOR_UDP_PORT, CLOUD_ELEVATOR_UDP_PORT_ALIAS, 150); //第三方对讲机UDP端口 this.AddOneGridViewColumn(grdView, THIRD_INTERCOM_UDP_PORT, THIRD_INTERCOM_UDP_PORT_ALIAS, 150); //云电梯数量 this.AddOneGridViewColumn(grdView, CLOUD_ELEVATOR_COUNT, CLOUD_ELEVATOR_COUNT_ALIAS, 100); //云电梯IP和门属性 for (int i = 1; i <= AppConst.LINKAGE_CTRL_CLOUD_ELEVATOR_MAX_COUNT; i++) { this.AddOneGridViewColumn(grdView, string.Format(CLOUD_ELEVATOR_ITEM_IP, i), string.Format(CLOUD_ELEVATOR_ITEM_IP_ALIAS, i), 120); this.AddOneGridViewColumn(grdView, string.Format(CLOUD_ELEVATOR_ITEM_PROP, i), string.Format(CLOUD_ELEVATOR_ITEM_PROP_ALIAS, i), 120); } this.gcDevices.DataSource = f_DevicesDataTable; ControlUtilityTool.AdjustIndicatorWidth(grdView); }
protected virtual void InitUIOnShown() { if (UtilityTool.IsDesignMode()) { return; } this.InitUIEvents(); this.SetCaptionPosition(); ControlUtilityTool.SetITLSimpleButtonFlatStyle(this.btnOK); ControlUtilityTool.SetPanelControlBorderLines(this.pnlButtom, false, true, true, true); ControlUtilityTool.SetPanelControlBorderLines(this.pnlMain, false, true, true, true); ControlUtilityTool.SetControlDefaultFont(this.lblCaption, 12, FontStyle.Bold); ControlUtilityTool.SetControlDefaultColor(this.lblCaption, Color.White, ColorType.ctForeColor); ControlUtilityTool.SetControlDefaultColor(this.pnlMain, ControlUtilityTool.PubBackColorNormal); ControlUtilityTool.SetControlDefaultColor(this.pnlButtom, ControlUtilityTool.PubBackColorNormal); ControlUtilityTool.SetSuperToolTip(this.btnMin, "最小化"); ControlUtilityTool.SetSuperToolTip(this.btnMax, "最大化"); ControlUtilityTool.SetSuperToolTip(this.btnClose, "关闭"); this.btnOK.Top = (this.pnlButtom.Height - this.btnOK.Height) / 2; this.btnOK.Left = this.pnlButtom.Width - 25 - this.btnOK.Width; this.btnMin.Visible = false; this.btnMax.Visible = false; }
protected override void InitUIOnLoad() { base.InitUIOnLoad(); ControlUtilityTool.SetITLLayOutControlStyle(this.lcLinkageCtrl); ControlUtilityTool.SetITLTextEditStyle(this.edtDevIp); ControlUtilityTool.SetITLTextEditStyle(this.edtSubnetMark); ControlUtilityTool.SetITLTextEditStyle(this.edtGateWay); ControlUtilityTool.SetITLTextEditStyle(this.edtCloudUdpPort); ControlUtilityTool.SetITLTextEditStyle(this.edtThirdUdpPort); ControlUtilityTool.SetITLComboBoxEditStyle(this.cmbCloudCtrlCount); ControlUtilityTool.SetControlDefaultColor(this.sclCtrlItems, ControlUtilityTool.PubBackColorNormal); ControlUtilityTool.SetTextEditIPRegEx(this.edtDevIp); ControlUtilityTool.SetTextEditIPRegEx(this.edtSubnetMark); ControlUtilityTool.SetTextEditIPRegEx(this.edtGateWay); this.edtDevIp.Properties.MaxLength = 15; this.edtSubnetMark.Properties.MaxLength = 15; this.edtGateWay.Properties.MaxLength = 15; this.edtCloudUdpPort.Properties.MaxLength = 5; this.edtThirdUdpPort.Properties.MaxLength = 5; this.edtDevIp.KeyPress += CommonUtils.edtIp_KeyPress; this.edtSubnetMark.KeyPress += CommonUtils.edtIp_KeyPress; this.edtGateWay.KeyPress += CommonUtils.edtIp_KeyPress; this.edtCloudUdpPort.KeyPress += CommonUtils.edtPort_KeyPress; this.edtThirdUdpPort.KeyPress += CommonUtils.edtPort_KeyPress; this.InitDevicesCountCmdEdit(); this.InitCloudElevatorItemsUI(); this.DevType = DeviceType.LinkageCtrl; HintProvider.WaitingDone(Application.ProductName); FindCount = new Dictionary <string, hintInfo>(); }
private void AddOneDeviceToUI(LinkageCtrlInfo linkageCtrlInfo) { DataRow[] rows = f_DevicesDataTable.Select(string.Format("{0}={1}", DEV_ID, linkageCtrlInfo.DevId)); FindCount.AddToUpdate("" + linkageCtrlInfo.DevId); FindCount.AddToUpdate("" + linkageCtrlInfo.DevIp); if (rows.Length > 0) { rows[0].BeginEdit(); try { int FindSumCount = AppEnv.Singleton.UdpCount * AppEnv.Singleton.UdpCount + 1; if (FindCount["" + linkageCtrlInfo.DevId].FontCount > FindSumCount && !FindCount["" + linkageCtrlInfo.DevId].IsHint) { FindCount["" + linkageCtrlInfo.DevId].IsHint = true; HintProvider.ShowAutoCloseDialog(null, "设备ID冲突,ID:" + linkageCtrlInfo.DevId); } if (FindCount[linkageCtrlInfo.DevIp].FontCount > FindSumCount && !FindCount["" + linkageCtrlInfo.DevIp].IsHint) { FindCount["" + linkageCtrlInfo.DevIp].IsHint = true; HintProvider.ShowAutoCloseDialog(null, string.Format("设备IP冲突,IP:{0},ID:{1}", linkageCtrlInfo.DevIp, linkageCtrlInfo.DevId)); } rows[0][DEV_MAC] = linkageCtrlInfo.DevMac; rows[0][DEV_IP] = linkageCtrlInfo.DevIp; rows[0][SUBNET_MARK] = linkageCtrlInfo.SubnetMask; rows[0][GATE_WAY] = linkageCtrlInfo.GateWay; rows[0][CLOUD_ELEVATOR_UDP_PORT] = linkageCtrlInfo.CloudUdpPort; rows[0][THIRD_INTERCOM_UDP_PORT] = linkageCtrlInfo.ThirdUdpPort; rows[0][CLOUD_ELEVATOR_COUNT] = linkageCtrlInfo.CloudElevatorCount; for (int i = 1; i <= 8; i++) { rows[0][string.Format(CLOUD_ELEVATOR_ITEM_IP, i)] = linkageCtrlInfo.CloudElevatorItems[i].DevIp; rows[0][string.Format(CLOUD_ELEVATOR_ITEM_PROP, i)] = CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[i].CtrlProporties); } } finally { rows[0].EndEdit(); } } else { f_DevicesDataTable.Rows.Add(linkageCtrlInfo.DevId, linkageCtrlInfo.DevMac, linkageCtrlInfo.DevIp, linkageCtrlInfo.SubnetMask, linkageCtrlInfo.GateWay, linkageCtrlInfo.CloudUdpPort, linkageCtrlInfo.ThirdUdpPort, linkageCtrlInfo.CloudElevatorCount, linkageCtrlInfo.CloudElevatorItems[1].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[1].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[2].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[2].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[3].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[3].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[4].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[4].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[5].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[5].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[6].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[6].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[7].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[7].CtrlProporties), linkageCtrlInfo.CloudElevatorItems[8].DevIp, CommonUtils.GetNameByCloudElevatorProperties(linkageCtrlInfo.CloudElevatorItems[8].CtrlProporties) ); } //排序 f_DevicesDataTable.DefaultView.Sort = string.Format("{0} {1}", DEV_ID, "ASC"); ControlUtilityTool.AdjustIndicatorWidth(this.gvDevices); }