Build() public method

public Build ( ) : Orchard.ContentManagement.MetaData.Models.ContentPartDefinition
return Orchard.ContentManagement.MetaData.Models.ContentPartDefinition
 public static void AlterPartDefinition(this IContentDefinitionManager manager, string name, Action<ContentPartDefinitionBuilder> alteration)
 {
     var partDefinition = manager.GetPartDefinition(name) ?? new ContentPartDefinition(name);
     var builder = new ContentPartDefinitionBuilder(partDefinition);
     alteration(builder);
     manager.StorePartDefinition(builder.Build());
 }
        public override void PartEditorUpdated(ContentPartDefinitionBuilder builder) {
            var contentPartDefinition = builder.Build();
            var newPartSettings = contentPartDefinition.Settings;

            if (newPartSettings.ContainsKey(_contentPartSettingsDescriptionName)) {
                var oldDescription = _oldPartSettings.Get(_contentPartSettingsDescriptionName);
                var newDescription = newPartSettings.Get(_contentPartSettingsDescriptionName);
                if (oldDescription != newDescription) {
                    var eventData = new Dictionary<string, object> {
                        {"ContentPartName", builder.Name},
                        {"OldDescription", oldDescription},
                        {"NewDescription", newDescription}
                    };
                    RecordContentPartAuditTrail(ContentPartAuditTrailEventProvider.DescriptionChanged, eventData, builder.Name);
                }
            }

            // Description change should not be re-recorded as general settings change.
            var remainingOldPartSettings = new SettingsDictionary(_oldPartSettings.Where(item => item.Key != _contentPartSettingsDescriptionName).ToDictionary(item => item.Key, item => item.Value));
            var remainingNewPartSettings = new SettingsDictionary(newPartSettings.Where(item => item.Key != _contentPartSettingsDescriptionName).ToDictionary(item => item.Key, item => item.Value));

            if (!AreEqual(remainingNewPartSettings, remainingOldPartSettings)) {
                var eventData = new Dictionary<string, object> {
                    {"ContentPartName", builder.Name},
                    {"OldSettings", ToXml(remainingOldPartSettings)},
                    {"NewSettings", ToXml(remainingNewPartSettings)}
                };
                RecordContentPartAuditTrail(ContentPartAuditTrailEventProvider.PartSettingsUpdated, eventData, builder.Name);
            }
        }