| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- using System.ComponentModel;
- using System.Runtime.CompilerServices;
- namespace DeviceCenter
- {
- public class Device : INotifyPropertyChanged
- {
- private string _name;
- private string _ip;
- private int _port;
- private string _username;
- private string _password;
- private DeviceType _type;
- private DeviceStatus _status;
- private Direction _direction;
- public long? areaId { get; set; }
- public long? buildingId { get; set; }
- public long? floorId { get; set; }
- private string _message;
- public Device() { }
- public string name
- {
- get { return _name; }
- set
- {
- _name = value;
- OnPropertyChanged();
- }
- }
- public string ip
- {
- get
- {
- return _ip;
- }
- set
- {
- _ip = value;
- OnPropertyChanged("ip");
- }
- }
- public int port
- {
- get
- {
- return _port;
- }
- set
- {
- _port = value;
- OnPropertyChanged("port");
- }
- }
- public string username
- {
- get
- {
- return _username;
- }
- set
- {
- _username = value;
- OnPropertyChanged("username");
- }
- }
- public string password
- {
- get
- {
- return _password;
- }
- set
- {
- _password = value;
- OnPropertyChanged("password");
- }
- }
- public DeviceStatus status
- {
- get
- {
- return _status;
- }
- set
- {
- _status = value;
- OnPropertyChanged();
- }
- }
- public DeviceType type
- {
- get
- {
- return _type;
- }
- set
- {
- _type = value;
- OnPropertyChanged();
- }
- }
- public Direction direction
- {
- get
- {
- return _direction;
- }
- set
- {
- _direction = value;
- OnPropertyChanged();
- }
- }
- public string message
- {
- get
- {
- return _message;
- }
- set
- {
- _message = value;
- OnPropertyChanged();
- }
- }
- public event PropertyChangedEventHandler PropertyChanged;
- public virtual void Init() { }
- public virtual void dispose() { }
- protected void OnPropertyChanged([CallerMemberName] string name = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
- }
- }
|