lixiaojun
2024-11-30 ff39bbf7e3a3d02f7f051ce1bee06cec007be3ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
namespace HStation.Model
{
    /// <summary>
    /// 组件
    /// </summary>
    public abstract class RevitParter
    {
        /// <summary>
        /// 
        /// </summary>
        public RevitParter() { }
 
        /// <summary>
        /// 
        /// </summary>
        public RevitParter(Model.RevitParter rhs)
        {
            this.Id = rhs.Id;
            this.Catalog = rhs.Catalog;
            this.Name = rhs.Name;
            this.ModelType = rhs.ModelType;
            this.Flags = rhs.Flags;
            this.Description = rhs.Description;
 
            this.PropValueList = rhs.PropValueList?.Select(x => new RevitPropValue(x)).ToList();
            this.PropStatusList = rhs.PropStatusList?.Select(x => new RevitPropStatus(x)).ToList();
        }
 
        /// <summary>
        /// Id
        /// </summary>
        public string Id { get; set; }
 
        /// <summary>
        /// 分类
        /// </summary>
        public string Catalog { get; set; }
 
        /// <summary>
        /// 名称
        /// </summary>    
        public string Name { get; set; }
 
        /// <summary>
        /// 型号
        /// </summary>
        public string ModelType { get; set; }
 
        /// <summary>
        /// 标签
        /// </summary>
        public List<string> Flags { get; set; }
 
        /// <summary>
        /// 说明
        /// </summary>    
        public string Description { get; set; }
 
        /// <summary>
        /// 属性值列表
        /// </summary>
        public List<RevitPropValue> PropValueList { get; set; }
 
        /// <summary>
        /// 属性状态列表
        /// </summary>
        public List<RevitPropStatus> PropStatusList { get; set; }
 
        /// <summary>
        /// 获取属性名称
        /// </summary>
        public RevitPropStatus GetPropStatus(string propName)
        {
            if (string.IsNullOrEmpty(propName))
            {
                return default;
            }
            var propStatus = this.PropStatusList?.Find(x => x.PropName == propName);
            return propStatus;
        }
 
        /// <summary>
        /// 更新属性状态
        /// </summary>
        public bool UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
        {
            if (string.IsNullOrEmpty(propName))
            {
                return false;
            }
            if (this.PropStatusList == null)
            {
                this.PropStatusList = new List<Model.RevitPropStatus>();
            }
            var propStatusModel = this.GetPropStatus(propName);
            if (propStatusModel == null)
            {
                propStatusModel = new Model.RevitPropStatus() { PropName = propName };
                this.PropStatusList.Add(propStatusModel);
            }
            propStatusModel.PropStatus = propStatus;
            propStatusModel.StatusInfo = statusInfo;
            return true;
        }
 
 
    }
}