GElement.cs 994 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Media;
  7. namespace SAGA.Models.Graphs
  8. {
  9. public class GElement
  10. {
  11. public GElement()
  12. {
  13. ElementType = GetElementType();
  14. ElementColor = Colors.Black;
  15. }
  16. protected virtual string GetElementType()
  17. {
  18. return "基础类型";
  19. }
  20. /// <summary>
  21. /// 关联Id
  22. /// </summary>
  23. public string Id { get; internal set; }
  24. public string Name { get; set; } = string.Empty;
  25. /// <summary>
  26. /// 元素类型
  27. /// </summary>
  28. public string ElementType { get; private set; }
  29. public Color ElementColor { get; set; }
  30. /// <summary>
  31. /// 关联数据
  32. /// </summary>
  33. public object RefData { get; set; }
  34. public void SetId(string id)
  35. {
  36. Id = id;
  37. }
  38. }
  39. }