private HtmlBodyPartSettings GetPartSettings(HtmlBodyPart part) { var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(part.ContentItem.ContentType); var contentTypePartDefinition = contentTypeDefinition.Parts.FirstOrDefault(p => p.PartDefinition.Name == nameof(HtmlBodyPart)); return(contentTypePartDefinition?.GetSettings <HtmlBodyPartSettings>()); }
private ContentTypePartSettings GetContentTypePartDefinition(HtmlBodyPart part) { var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(part.ContentItem.ContentType); var contentTypePartDefinition = contentTypeDefinition.Parts.FirstOrDefault(p => p.PartDefinition.Name == nameof(HtmlBodyPart)); return(contentTypePartDefinition?.Settings?["ContentTypePartSettings"]?.ToObject <ContentTypePartSettings>()); }