ICommunicationDebugPage.cs 992 B

12345678910111213141516171819
  1. using TeamAAS.Communication.Interfaces;
  2. namespace TeamAAS.Communication.UI
  3. {
  4. /// <summary>
  5. /// 通讯设备调试页约定:宿主(设置页的通讯管理)选中通讯设备后,把运行中的设备实例绑定给页面。
  6. /// 想为某个品牌/型号定制专属调试页,让页面(FrameworkElement 子类)实现此接口,
  7. /// 并在该设备类的 [Communication] 特性上通过 <see cref="Attributes.CommunicationAttribute.DebugPageType"/> 指定即可。
  8. /// 未指定时宿主使用通用的通讯测试面板。
  9. /// </summary>
  10. public interface ICommunicationDebugPage
  11. {
  12. /// <summary>绑定通讯设备实例(选中该设备/页面被装载时调用)。</summary>
  13. void BindCommunication(ICommunication communication);
  14. /// <summary>解绑通讯设备实例(切换设备/页面被卸载时调用,页面应停止使用设备并清理界面状态)。</summary>
  15. void UnbindCommunication();
  16. }
  17. }