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; }
private IFieldTypeService GetFieldTypeService() { return(FieldTypeServiceFactory.GetFieldTypeService(FieldType)); }