You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

55 lines
1.7 KiB

  1. using Microsoft.Toolkit.Mvvm.ComponentModel;
  2. using Microsoft.Toolkit.Mvvm.Input;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using HBLConsole.Interface;
  9. using Newtonsoft.Json;
  10. namespace HBLConsole.Model
  11. {
  12. public class CommunicationSet : ObservableObject
  13. {
  14. public CommunicationSet()
  15. {
  16. RemoveCommand = new RelayCommand<object>((o) => { if (RemoveAction != null) RemoveAction(o); });
  17. }
  18. public Action<object> RemoveAction { get; set; }
  19. /// <summary>
  20. /// 使用特性对接口反序列化
  21. /// </summary>
  22. [JsonProperty(TypeNameHandling = TypeNameHandling.Auto)]
  23. public IDeviceType Device { get { return _mDevice; } set { _mDevice = value; OnPropertyChanged(); } }
  24. private IDeviceType _mDevice;
  25. /// <summary>
  26. /// 是否激活
  27. /// </summary>
  28. public bool IsActive { get { return _mIsActive; } set { _mIsActive = value; OnPropertyChanged(); } }
  29. private bool _mIsActive = true;
  30. /// <summary>
  31. /// 新增设备名称
  32. /// </summary>
  33. public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
  34. private string _mDeviceName;
  35. /// <summary>
  36. /// 设备类型
  37. /// </summary>
  38. public EDeviceType deviceType { get { return _mdeviceType; } set { _mdeviceType = value; OnPropertyChanged(); } }
  39. private EDeviceType _mdeviceType;
  40. /// <summary>
  41. /// 客户端启动设备类型
  42. /// </summary>
  43. public string ClientDeviceType { get; set; }
  44. public RelayCommand<object> RemoveCommand { get; set; }
  45. }
  46. }