12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
-
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Threading.Tasks;
- using ServiceRevitLib.Mode;
- using Autodesk.Revit.DB;
- using ServiceRevitLib.DataCheck.Mode;
- using ServiceRevitLib.Extend;
- namespace ServiceRevitLib
- {
-
-
-
- public class CheckFactory:ResultBase
- {
- public CheckFactory()
- {
- Content=new List<CheckBase>();
- }
-
- #region 序列化的属性
- public List<CheckBase> Content { get; set; }
- public string FloorName { get; set; }
- #endregion
- #region Method
-
-
-
-
-
- public void SetCheckItems(string str)
- {
-
- var checkItemStrs = str.Split(',');
- var nameSpace = typeof(CheckBase).Namespace;
- foreach (string itemStr in checkItemStrs)
- {
-
- string fullPath = nameSpace + "." + itemStr;
- Assembly tempAsembly = Assembly.GetExecutingAssembly();
- var check = (tempAsembly.CreateInstance(fullPath)) as CheckBase;
- Content.Add(check);
- }
- }
- public void Check(Document doc)
- {
- FloorName = doc.PathName;
-
- try
- {
- Content.ForEach(t => t.SetDoc(doc));
- Content.ForEach(t => t.Check());
- }
- catch (Exception e)
- {
- ResultMsg = e.Message;
- Result = ResultState.Failure;
- }
- finally
- {
-
- }
- }
- #endregion
- }
- }
|