namespace HStation.Model
{
///
/// 组件
///
public abstract class RevitParter
{
///
///
///
public RevitParter() { }
///
///
///
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();
}
///
/// Id
///
public string Id { get; set; }
///
/// 分类
///
public string Catalog { get; set; }
///
/// 名称
///
public string Name { get; set; }
///
/// 型号
///
public string ModelType { get; set; }
///
/// 标签
///
public List Flags { get; set; }
///
/// 说明
///
public string Description { get; set; }
///
/// 属性值列表
///
public List PropValueList { get; set; }
///
/// 属性状态列表
///
public List PropStatusList { get; set; }
///
/// 获取属性名称
///
public RevitPropStatus GetPropStatus(string propName)
{
if (string.IsNullOrEmpty(propName))
{
return default;
}
var propStatus = this.PropStatusList?.Find(x => x.PropName == propName);
return propStatus;
}
///
/// 更新属性状态
///
public bool UpdatePropStatus(string propName, ePropStatus propStatus, string statusInfo)
{
if (string.IsNullOrEmpty(propName))
{
return false;
}
if (this.PropStatusList == null)
{
this.PropStatusList = new List();
}
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;
}
}
}