123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
-
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using JBIM.Common;
- using JBIM.Definition;
- namespace JBIM
- {
- [TypeDefiniton(TypeDefinition.BimObject)]
- public class BimObject
- {
- public BimObject()
- {
- ElementType = GetElementType();
- }
- public BimId Id { get; internal set; }
- public string ElementType { get; protected set; }
-
-
-
- public string Tag { get; set; }
-
-
-
-
- protected string GetElementType()
- {
- var attributes = this.GetType().GetCustomAttributes(typeof(TypeDefinitonAttribute), true);
- string result = null;
- if (attributes.Any())
- {
- result = (attributes[0] as TypeDefinitonAttribute)?.GetTypeDefiniton();
- }
- if (string.IsNullOrEmpty(result))
- {
- result = TypeDefinitonUtil.GetTypeDefiniton(TypeDefinition.BimObject);
- }
- return result;
- }
- }
- }
|