private void ComboBoxSelectedIndexChanged <T>(ComboBox comboBox, GetType <T> typeGetter, OnType <T> typeSetter) { var selectedIndex = comboBox.SelectedIndex; if ((selectedIndex >= 0) && (selectedIndex < comboBox.Items.Count)) { var typeString = comboBox.Items[selectedIndex].ToString(); var type = typeGetter(typeString); typeSetter(type); } }
public IActionResult AddType([FromBody] GetType v) { ProductType p = new ProductType(); p.type_name = v.type_name; p.description = v.description; p.is_active = 1; Boolean id = _service.AddType(p); if (id) { return(Ok()); } else { return(BadRequest()); } }
public CarList01 GetCarList(CarList01 cl, GetType t) { if (t == GetType.Up) { List <CarList01> tmp = new List <CarList01>(); foreach (var it in panList.Controls) { tmp.Add((CarList01)it); } if (cl.Location.Y == 0) { return(null); } Control ctrl = tmp.First(x => x.Location == new Point(0, cl.Location.Y - 40)); return((CarList01)ctrl); } else { List <CarList01> tmp = new List <CarList01>(); foreach (var it in panList.Controls) { tmp.Add((CarList01)it); } if (cl.Location.Y == panList.Height - 40) { return(null); } Control ctrl = tmp.First(x => x.Location == new Point(0, cl.Location.Y + 40)); return((CarList01)ctrl); } }
internal StationList01 GetStationList(StationList01 sl, GetType t) { if (t == GetType.Up) { List <StationList01> tmp = new List <StationList01>(); foreach (var it in panList.Controls) { tmp.Add((StationList01)it); } if (sl.Location.Y == 0) { return(null); } Control ctrl = tmp.First(x => x.Location == new Point(0, sl.Location.Y - 40)); return((StationList01)ctrl); } else { List <StationList01> tmp = new List <StationList01>(); foreach (var it in panList.Controls) { tmp.Add((StationList01)it); } if (sl.Location.Y == panList.Height - 40) { return(null); } Control ctrl = tmp.First(x => x.Location == new Point(0, sl.Location.Y + 40)); return((StationList01)ctrl); } }
_runner = new BDDRunner(GetType());
public OnlineResourceEnumerator(GetType par) { this.SetSamplerState(0, SamplerStateparent = par; this.SetSamplerState(0, SamplerStatenIndex = -1; }
: string.Concat(GetType(parameter.ReflectedType.GetTypeInfo()), _separator, parameter.Name);
public override int GetHashCode() { return((GetType.GetHashCode() * 907) + ID.GetHashCode()); }
public override void SetData(System.Xml.XmlNode node) { base.SetData(node); GType = (GetType)int.Parse(node.ChildNodes[5].InnerText); }
<TypeConverter(GetType(StringConverter))> _
<Editor(GetType(ImageComboItemEditor), GetType(UITypeEditor)), _