public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { var types = RelayType.FindAll(); var names = new ArrayList(); if (types != null && types.Count > 0) { names.AddRange(types); } return(new StandardValuesCollection(names)); }
/// <summary> /// 初始化继电器类型 /// </summary> private void InitRelayType() { var relayTypeList = RelayType.FindAll().ToList(); if (relayTypeList.Any() && relayTypeList.Count > 0) { this.cbRelay.DataSource = relayTypeList; this.cbRelay.DisplayMember = "Remark"; this.cbRelay.ValueMember = "ID"; } }
private void BaseConfig_Load(object sender, EventArgs e) { if (ClassName.EqualIgnoreCase("CommunicateDeviceType")) { this.Name = "CommunicateDeviceType"; var types = CommunicateDeviceType.FindAll(); this.dataGridViewX1.DataSource = types; } if (ClassName.EqualIgnoreCase("Sensor")) { this.Name = "Sensor"; this.dataGridViewX1.DataSource = Sensor.FindAll(); } if (ClassName.EqualIgnoreCase("RelayType")) { this.Name = "RelayType"; this.dataGridViewX1.DataSource = RelayType.FindAll(); } if (ClassName.EqualIgnoreCase("ControlJobType")) { this.Name = "ControlJobType"; this.dataGridViewX1.DataSource = ControlJobType.FindAll(); } if (ClassName.EqualIgnoreCase("DeviceType")) { this.Name = "DeviceType"; this.dataGridViewX1.DataSource = DeviceType.FindAll(); } if (ClassName.EqualIgnoreCase("FacilityType")) { this.Name = "FacilityType"; this.dataGridViewX1.DataSource = FacilityType.FindAll(); } if (ClassName.EqualIgnoreCase("ProtocalType")) { this.Name = "ProtocalType"; this.dataGridViewX1.DataSource = ProtocalType.FindAll(); } if (ClassName.EqualIgnoreCase("ShowDeviceType")) { this.Name = "ShowDeviceType"; this.dataGridViewX1.DataSource = ShowDeviceType.FindAll(); } }