64 lines
1.7 KiB
C#
64 lines
1.7 KiB
C#
|
|
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
|
|
{
|
|
/// <summary>
|
|
/// 从MvdLite读取实体后转换的属性
|
|
/// </summary>
|
|
public partial class AfcaArchiProperty : ObservableObject
|
|
{
|
|
/// <summary>
|
|
/// 所属分类
|
|
/// </summary>
|
|
public string DefinitionName { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool IsChecked { get; set; }
|
|
/// <summary>
|
|
/// 参数名
|
|
/// </summary>
|
|
public string Name { get; set; }
|
|
/// <summary>
|
|
/// 默认值
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
public partial string DefaultValue { get; set; }
|
|
|
|
partial void OnDefaultValueChanged(string oldValue, string newValue)
|
|
{
|
|
PropertyAssists.SetDefaultValue(DefinitionName, Name, newValue);
|
|
PropertyAssists.Save();
|
|
}
|
|
/// <summary>
|
|
/// 可选的值约束
|
|
/// </summary>
|
|
[ObservableProperty]
|
|
public partial string[] ValueConstraints { get; set; }
|
|
/// <summary>
|
|
/// 值范围
|
|
/// </summary>
|
|
public string ValueRange { get; set; }
|
|
|
|
public ParameterType ParameterType
|
|
{
|
|
get
|
|
{
|
|
if (ValueRange != null && ValueRange.Contains("实数值"))
|
|
{
|
|
return ParameterType.Number;
|
|
}
|
|
return ParameterType.Text;
|
|
}
|
|
}
|
|
}
|
|
} |