CheckBase.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* ==============================================================================
  2. * 功能描述:CheckBase
  3. * 创 建 者:Garrett
  4. * 创建日期:2019/6/11 16:01:26
  5. * ==============================================================================*/
  6. using System;
  7. using System.Collections.Generic;
  8. using Autodesk.Revit.DB;
  9. using Newtonsoft.Json;
  10. using ServiceRevitLib.Mode;
  11. namespace ServiceRevitLib.DataCheck.Mode
  12. {
  13. /// <summary>
  14. /// CheckBase
  15. /// </summary>
  16. public class CheckBase:ResultBase
  17. {
  18. public CheckBase()
  19. {
  20. Content=new List<ResultBase>();
  21. }
  22. private string m_Name;
  23. /// <summary>
  24. /// 检查项名称
  25. /// </summary>
  26. public string Name
  27. {
  28. get { return this.GetType().Name; }
  29. }
  30. public List<ResultBase> Content { get; set; }
  31. /// <summary>
  32. /// 关联表的名称
  33. /// </summary>
  34. [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
  35. public string ReferenceSheet { get; set; }
  36. #region Method
  37. protected Document m_Doc { get; set; }
  38. public void SetDoc(Document doc)
  39. {
  40. m_Doc = doc;
  41. }
  42. public virtual void Check()
  43. {
  44. if(m_Doc==null)throw new NullReferenceException();
  45. Console.WriteLine(this.Name + "Checked");
  46. }
  47. #endregion
  48. }
  49. }