该FieldAttribute.Group
属性在应用于集合时不起作用。在下面的示例中,在规则编辑器中,我得到了两个菜单项(组、其他)。在我得到的group
菜单项MyField
下,OTHER
我得到MyCollection
和OtherField
。我希望group
有MyField
and MyCollection
。
public class MyModel
{
[Field(Settable = false, Group = "group")]
public int MyField { get; set; }
[Field(Settable = false, Group = "group")]
public List<int> MyCollection { get; set; }
[Field(Settable = false)]
public int OtherField { get; set; }
}
// here is how the editor is instantiated
RuleEditor editor = new RuleEditor("divRuleEditor")
{
Mode = Common.RuleType.Execution,
SourceType = typeof(MyModel)
};