using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;
using Autodesk.Revit.DB;
using CommunityToolkit.Mvvm.ComponentModel;
using Dapper;
using Dapper.Contrib.Extensions;
using Newtonsoft.Json;
namespace Szmedi.RevitToolkit.Approval.Models
{
///
/// 从MvdLite读取实体后转换的属性
///
public partial class AfcaArchiProperty : ObservableObject
{
///
/// 所属分类
///
public string DefinitionName { get; set; }
[ObservableProperty]
public partial bool IsChecked { get; set; }
///
/// 参数名
///
public string Name { get; set; }
///
/// 默认值
///
[ObservableProperty]
public partial string DefaultValue { get; set; }
partial void OnDefaultValueChanged(string oldValue, string newValue)
{
PropertyAssists.SetDefaultValue(DefinitionName, Name, newValue);
PropertyAssists.Save();
}
///
/// 可选的值约束
///
[ObservableProperty]
public partial string[] ValueConstraints { get; set; }
///
/// 值范围
///
public string ValueRange { get; set; }
public ParameterType ParameterType
{
get
{
if (ValueRange != null && ValueRange.Contains("实数值"))
{
return ParameterType.Number;
}
return ParameterType.Text;
}
}
}
}