private void Apply(ContentTypePartDefinition model, ContentTypePartDefinitionRecord record)
 {
     record.Settings = Compose(_settingsFormatter.Map(model.Settings));
 }
 public ContentTypeDefinitionBuilder WithPart(ContentPartDefinition partDefinition, Action<ContentTypePartDefinitionBuilder> configuration)
 {
     var existingPart = _parts.SingleOrDefault(x => x.PartDefinition.Name == partDefinition.Name);
     if (existingPart != null) {
         _parts.Remove(existingPart);
     }
     else {
         existingPart = new ContentTypePartDefinition(partDefinition, new SettingsDictionary());
     }
     var configurer = new PartConfigurerImpl(existingPart);
     configuration(configurer);
     _parts.Add(configurer.Build());
     return this;
 }
 protected ContentTypePartDefinitionBuilder(ContentTypePartDefinition part)
 {
     Name = part.PartDefinition.Name;
     TypeName = part.ContentTypeDefinition != null ? part.ContentTypeDefinition.Name : default(string);
     _settings = new SettingsDictionary(part.Settings.ToDictionary(kv => kv.Key, kv => kv.Value));
 }
 public PartConfigurerImpl(ContentTypePartDefinition part)
     : base(part)
 {
     Current = part;
     _partDefinition = part.PartDefinition;
 }