| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading.Tasks;
- namespace DeviceCenter
- {
- abstract class Device : INotifyPropertyChanged
- {
- private string _name;
- private string _ip;
- private Device.Type _type;
- private Device.Status _status;
- public enum Type
- {
- [Description("车牌识别")]
- CAR_CAM,
- [Description("门禁")]
- ACS
- }
- public enum Status
- {
- IDEL,
- CONNECTING,
- CONNECTED,
- FAIL
- }
- public string name
- {
- get { return _name; }
- set
- {
- _name = value;
- OnPropertyChanged();
- }
- }
- public string ip
- {
- get
- {
- return _ip;
- }
- set
- {
- _ip = value;
- OnPropertyChanged("ip");
- }
- }
- public Status status
- {
- get
- {
- return _status;
- }
- set
- {
- _status = value;
- OnPropertyChanged();
- }
- }
- public Type type
- {
- get {
- return _type;
- }
- set
- {
- _type = value;
- OnPropertyChanged();
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- abstract public void Init();
- abstract public void dispose();
- protected void OnPropertyChanged([CallerMemberName] string name = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
- }
- }
|