CameraAttribute.cs 1.0 KB

123456789101112131415161718192021222324252627
  1. using System;
  2. namespace TeamAAS.Camera.Attributes
  3. {
  4. [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
  5. public sealed class CameraAttribute : Attribute
  6. {
  7. public string DisplayName { get; }
  8. public string Brand { get; }
  9. public string Description { get; }
  10. /// <summary>
  11. /// 品牌专属调试页类型(必须是 <c>System.Windows.FrameworkElement</c> 的子类,且建议实现
  12. /// <c>TeamAAS.Camera.UI.ICameraDebugPage</c> 以接收相机实例)。
  13. /// 为 null(默认)时,宿主使用类库内置的通用调试页。
  14. /// 用法:[Camera("康耐视 VisionPro", "康耐视 VisionPro", DebugPageType = typeof(CognexDebugPage))]
  15. /// </summary>
  16. public Type DebugPageType { get; set; }
  17. public CameraAttribute(string displayName, string brand, string description = "")
  18. {
  19. DisplayName = displayName;
  20. Brand = brand;
  21. Description = description;
  22. }
  23. }
  24. }