1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
-
- 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.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
- }
- }
|