示例#1
0
        private void PopulateFromModel(RangeModel rangeModel)
        {
            //Set the name
            Name = rangeModel.Name;

            //Ditch the old fields
            _fieldEditors.Clear();

            //Create the fields
            _fields = rangeModel.Fields.Select(f => FieldTypeServiceFactory.GetFieldTypeService(f.FieldType).CreateRuntimeField(f)).ToArray();

            //Set up the field editors
            _fieldEditors.AddRange(_fields.SelectMany(f => f.FieldEditors));

            //Save this
            _rangeModel = rangeModel;

            //To expand or not expand. That is the question. Whether tis nobler to...
            IsExpanded = rangeModel.IsExpanded;
        }
示例#2
0
 private IFieldTypeService GetFieldTypeService()
 {
     return(FieldTypeServiceFactory.GetFieldTypeService(FieldType));
 }