Ejemplo n.º 1
0
        public DialogResult Add(DeviceType deviceType, IStation station, out IDevice newDevice)
        {
            if (deviceType == null)
            {
                throw new ArgumentNullException("deviceType");
            }

            if (station == null)
            {
                throw new ArgumentNullException("station");
            }

            return OnAdd(deviceType, station, out newDevice);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="deviceType"></param>
        /// <param name="station"></param>
        /// <param name="newDevice"></param>
        /// <returns></returns>
        protected override DialogResult OnAdd(DeviceType deviceType, IStation station, out IDevice newDevice)
        {
            newDevice = null;
            FrmDeviceGroups f = new FrmDeviceGroups();

            f.DeviceType = deviceType;
            //f.Device = (IDevice)Activator.CreateInstance(f.DeviceType.Type);
            f.Device = f.DeviceType.Create(this.Dpu);
            f.Station = station;
            f.AdeStatus = ADEStatus.Add;
            f.Groups = f.Device.Groups;

            DialogResult dr = f.ShowDialog();
            if (dr == DialogResult.OK)
            {
                newDevice = f.Device;
            }
            return dr;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 private IDeviceUI GetDeviceUI(DeviceType deviceType)
 {
     IDPU dpu = this.Soft.DPUs[deviceType];
     if (dpu == null)
     {
         throw new InvalidOperationException(
             string.Format("not find dpu by device type '{0}'", deviceType));
     }
     return dpu.DeviceUI;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="deviceType"></param>
 /// <param name="station"></param>
 /// <param name="newDevice"></param>
 /// <returns></returns>
 protected abstract DialogResult OnAdd(DeviceType deviceType, IStation station, out IDevice newDevice);