| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- 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
- {
- CAR_CAM,
- 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));
- }
- }
- }
|