コード例 #1
0
        protected override FieldDefinition GetFieldDefinitionTemplate()
        {
            var def = new MultiChoiceFieldDefinition();

            var choiceCount = Rnd.Int(10) + 1;

            for (var index = 0; index < choiceCount; index++)
            {
                def.Choices.Add(Rnd.String(8));
                def.Mappings.Add(Rnd.String(8));
            }

            return def;
        }
コード例 #2
0
        protected override FieldDefinition GetFieldDefinitionTemplate()
        {
            var def = new MultiChoiceFieldDefinition();

            var choiceCount = Rnd.Int(10) + 1;

            for (var index = 0; index < choiceCount; index++)
            {
                var choiceValue = Rnd.String(8);

                def.Choices.Add(choiceValue);
                def.Mappings.Add(choiceValue);
            }

            defaultValue = Rnd.RandomFromArray(def.Choices);

            def.DefaultValue = defaultValue;

            return def;
        }
コード例 #3
0
 public static ModelNode AddMultiChoiceField(this ModelNode model, MultiChoiceFieldDefinition definition, Action<ModelNode> action)
 {
     return model.AddDefinitionNode(definition, action);
 }
コード例 #4
0
 public static ModelNode AddMultiChoiceField(this ModelNode model, MultiChoiceFieldDefinition definition)
 {
     return AddMultiChoiceField(model, definition, null);
 }