MapOperInterface.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using SuperMap.UI;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. namespace WWPipeLine.MapBasic
  9. {
  10. /// <summary>
  11. /// 为统一管理地图操作状态设置的基类
  12. /// </summary>
  13. public abstract class MapOperInterface
  14. {
  15. protected Form m_FormMain;
  16. protected MapControl m_MapControl;
  17. public static Dictionary<string, MapOperInterface> AllMapOperInterface = new Dictionary<string, MapOperInterface>();
  18. public static void Remove(Type t)
  19. {
  20. if (AllMapOperInterface.ContainsKey(t.FullName))
  21. {
  22. AllMapOperInterface.Remove(t.FullName);
  23. }
  24. }
  25. protected bool m_UnRegistered;
  26. public virtual bool UnRegistered { get => m_UnRegistered; set => m_UnRegistered = value; }
  27. public MapOperInterface(MapControl mapControl, Form formMain)
  28. {
  29. AllMapOperInterface.Add(this.GetType().FullName, this);
  30. m_MapControl = mapControl;
  31. m_FormMain = formMain;
  32. }
  33. /// <summary>
  34. /// 取消注册。备注:virtual void UnRegister
  35. /// </summary>
  36. public virtual void UnRegister() { }
  37. }
  38. }