protected ContentTypePartDefinitionBuilder(ContentTypePartDefinition part)
 {
     Name = part.PartDefinition.Name;
     _settings = new SettingsDictionary(part.Settings.ToDictionary(kv => kv.Key, kv => kv.Value));
 }
 public PartConfigurerImpl(ContentTypePartDefinition part)
     : base(part)
 {
     _partDefinition = part.PartDefinition;
 }
 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;
 }
 private void Apply(ContentTypePartDefinition model, ContentTypePartDefinitionRecord record)
 {
     record.Settings = Compose(_settingsFormatter.Map(model.Settings));
 }