Esempio n. 1
0
        public UserElementField(ElementField elementField, decimal rating)
            : this()
        {
            Validations.ArgumentNullOrDefault(elementField, nameof(elementField));

            ElementField = elementField;
            Rating       = rating;
        }
Esempio n. 2
0
        public ElementField AddField(string name, ElementFieldDataType fieldType, bool useFixedValue = true)
        {
            // TODO Validation - Same name?
            var sortOrder = Convert.ToByte(ElementFieldSet.Count + 1);
            var field     = new ElementField(this, name, fieldType, sortOrder, useFixedValue);

            ElementFieldSet.Add(field);
            return(field);
        }
Esempio n. 3
0
        public ElementCell(ElementField field, ElementItem item)
            : this()
        {
            Validations.ArgumentNullOrDefault(field, nameof(field));
            Validations.ArgumentNullOrDefault(item, nameof(item));

            ElementField = field;
            ElementItem  = item;
        }
Esempio n. 4
0
        public ElementCell AddCell(ElementField field)
        {
            Validations.ArgumentNullOrDefault(field, nameof(field));

            if (ElementCellSet.Any(item => item.ElementField == field))
            {
                throw new Exception("An element item can't have more than one cell for the same field.");
            }

            var cell = new ElementCell(field, this);

            field.ElementCellSet.Add(cell);
            ElementCellSet.Add(cell);
            return(cell);
        }