示例#1
0
 public ISPU this[StationType stationType]
 {
     get
     {
         ISPU r = null;
         foreach (ISPU item in this)
         {
             if (item.StationType == stationType)
             {
                 r = item;
                 break;
             }
         }
         return(r);
     }
 }
示例#2
0
文件: StationUI.cs 项目: hkiaipc/C3
        /// <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;
        }
示例#3
0
        /// <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);
        }
示例#4
0
        /// <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);
        }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="stationType"></param>
 static public void Remove(StationType stationType)
 {
     StationTypes.Remove(stationType);
 }