找回密码
 立即注册

QQ登录

只需一步,快速开始

诗仙·1957
金牌服务用户   /  发表于:2024-1-3 13:09  /   查看:678  /  回复:2
1金币
本帖最后由 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; }









附件: 您需要 登录 才可以下载或查看,没有帐号?立即注册

最佳答案

查看完整内容

问题跟进:大佬,这边找同事查看了您这个问题,列表属性,当类的成员变量为整数类型,在添加时,目前还不能支持自增的功能,针对这个问题会增加一个需求,编号42884,欢迎您继续积极反馈,帮助我们提升和完善产品功能。

2 个回复

倒序浏览
最佳答案
最佳答案
Shawn.Liu活字格认证
超级版主   /  发表于:2024-1-3 13:09:01
来自 3#
问题跟进:大佬,这边找同事查看了您这个问题,列表属性,当类的成员变量为整数类型,在添加时,目前还不能支持自增的功能,针对这个问题会增加一个需求,编号42884,欢迎您继续积极反馈,帮助我们提升和完善产品功能。
回复 使用道具 举报
Shawn.Liu活字格认证
超级版主   /  发表于:2024-1-3 13:43:08
2#
大佬,我们这边开发插件也是参考的语雀文档(列表属性 (yuque.com)),列表对象其中的属性自增如何开发问题我再帮您找同事请教下,有进展会跟帖回复。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部