Removing Name property on ContentTypeDefinitionBuilder and updating usages to use .Current.Name.

This commit is contained in:
Sipke Schoorstra
2014-09-25 13:04:13 -07:00
parent f0efbeb406
commit a096e3abd1
2 changed files with 4 additions and 8 deletions

View File

@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Orchard.AuditTrail.Helpers;
using Orchard.AuditTrail.Services;
using Orchard.ContentManagement.MetaData;
@@ -38,7 +36,7 @@ namespace Orchard.AuditTrail.Providers.ContentDefinition {
}
public override void TypeEditorUpdating(ContentTypeDefinitionBuilder definition) {
var contentType = _contentDefinitionService.GetType(definition.Name);
var contentType = _contentDefinitionService.GetType(definition.Current.Name);
_oldContentTypeDisplayName = contentType.DisplayName;
_oldContentTypeSettings = new SettingsDictionary(contentType.Settings);
}
@@ -50,7 +48,7 @@ namespace Orchard.AuditTrail.Providers.ContentDefinition {
if (newDisplayName != _oldContentTypeDisplayName) {
var eventData = new Dictionary<string, object> {
{"ContentTypeName", builder.Name},
{"ContentTypeName", builder.Current.Name},
{"OldDisplayName", _oldContentTypeDisplayName},
{"NewDisplayName", newDisplayName}
};
@@ -59,7 +57,7 @@ namespace Orchard.AuditTrail.Providers.ContentDefinition {
if (!AreEqual(newSettings, _oldContentTypeSettings)) {
var eventData = new Dictionary<string, object> {
{"ContentTypeName", builder.Name},
{"ContentTypeName", builder.Current.Name},
{"OldSettings", ToXml(_oldContentTypeSettings)},
{"NewSettings", ToXml(newSettings)}
};

View File

@@ -31,8 +31,6 @@ namespace Orchard.ContentManagement.MetaData.Builders {
}
}
public string Name { get { return _name; } }
public ContentTypeDefinition Build() {
return new ContentTypeDefinition(_name, _displayName, _parts, _settings);
}