public ISPU this[StationType stationType] { get { ISPU r = null; foreach (ISPU item in this) { if (item.StationType == stationType) { r = item; break; } } return(r); } }
/// <summary> /// /// </summary> /// <param name="stationType"></param> /// <param name="newStation"></param> /// <returns></returns> public DialogResult Add(StationType stationType, StationCollection stations, out IStation newStation) { newStation = null; Debug.Assert(stationType != null); Debug.Assert(stations != null); FrmStationGroups f = new FrmStationGroups(); f.AdeStatus = ADEStatus.Add; f.StationType = stationType; f.Stations = stations; f.Station = stationType.Create(this.Spu); f.Groups = f.Station.Groups; DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { newStation = f.Station; } return dr; }
/// <summary> /// /// </summary> /// <param name="typeName"></param> /// <returns></returns> static public StationType GetStationType(string typeName) { StationType r = null; foreach (StationType item in StationTypes) { //if (StringHelper.Equal(this1.Name, typeName)) if (StringHelper.Equal(item.Type.Name, typeName)) { r = item; break; } } //if (r == null) //{ // r = new DeviceType(typeName); // DeviceTypes.Add(r); //} return(r); }
/// <summary> /// /// </summary> /// <param name="stationType"></param> /// <param name="newStation"></param> /// <returns></returns> public DialogResult Add(StationType stationType, StationCollection stations, out IStation newStation) { newStation = null; Debug.Assert(stationType != null); Debug.Assert(stations != null); FrmStationGroups f = new FrmStationGroups(); f.AdeStatus = ADEStatus.Add; f.StationType = stationType; f.Stations = stations; f.Station = stationType.Create(this.Spu); f.Groups = f.Station.Groups; DialogResult dr = f.ShowDialog(); if (dr == DialogResult.OK) { newStation = f.Station; } return(dr); }
/// <summary> /// /// </summary> /// <param name="stationType"></param> static public void Remove(StationType stationType) { StationTypes.Remove(stationType); }