本帖最后由 Simon.hu 于 2024-1-5 11:58 编辑
在列表属性,的整数 执行顺序,如何控制为自增数字。
添加时候 自动加1
public class buzou1 : ObjectPropertyBase
{
[IntProperty(Min = 1, Max = 15)]
public int 执行顺序 { get; set; }
[ComboProperty(ValueList = "点击|输入|获取所有窗口|进入指定窗口", DisplayList = "点击|输入|获取所有窗口|进入指定窗口")]
public string 执行动作 { get; set; } = "点击";
[IntProperty(Min = 1, Max = 8)]
public int 延迟时间秒 { get; set; } = 1;
}
[ListProperty]
public List<buzou1> 步骤 { get; set; }
另外在对象列表中,动态隐藏是生效的,如:
public class buzou : ObjectPropertyBase, INamedObject
{
[Browsable(false)]
public string Name { get; set; }
[ComboProperty(ValueList = "中文汉字|纯英文|其他", DisplayList = "中文汉字|纯英文|其他")]
public string 执行动作1 { get; set; }
public string 输入内容 { get; set; }
public override bool GetDesignerPropertyVisible(string propertyName)
{
if (propertyName == nameof(输入内容))
{
return 执行动作1 == "中文汉字";
}
return base.GetDesignerPropertyVisible(propertyName);
}
}
[ObjectListProperty(ItemType = typeof(buzou))]
public List<INamedObject> 编辑步骤 { get; set; } = new List<INamedObject>();
在列表中不生效
如:
public class buzou1 : ObjectPropertyBase
{
[ComboProperty(ValueList = "点击|输入|获取所有窗口|进入指定窗口", DisplayList = "点击|输入|获取所有窗口|进入指定窗口")]
public string 执行动作 { get; set; }
[FormulaProperty]
public object 输入 { get; set; }
// 等于时则可见
public override bool GetDesignerPropertyVisible(string propertyName)
{
if (propertyName == nameof(输入))
{
return 执行动作 == "输入";
}
return base.GetDesignerPropertyVisible(propertyName);
}
}
[ListProperty]
public List<buzou1> 步骤 { get; set; }
|