mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-25 19:17:13 +08:00
Refactoring Import methods
This commit is contained in:
@@ -110,10 +110,14 @@ namespace Orchard.PublishLater.Drivers {
|
||||
}
|
||||
|
||||
protected override void Importing(PublishLaterPart part, ImportContentContext context) {
|
||||
var scheduledUtc = context.Attribute(part.PartDefinition.Name, "ScheduledPublishUtc");
|
||||
if (scheduledUtc != null) {
|
||||
part.ScheduledPublishUtc.Value = XmlConvert.ToDateTime(scheduledUtc, XmlDateTimeSerializationMode.Utc);
|
||||
// Don't do anything if the tag is not specified.
|
||||
if (context.Data.Element(part.PartDefinition.Name) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
context.ImportAttribute(part.PartDefinition.Name, "ScheduledPublishUtc", scheduledUtc =>
|
||||
part.ScheduledPublishUtc.Value = XmlConvert.ToDateTime(scheduledUtc, XmlDateTimeSerializationMode.Utc)
|
||||
);
|
||||
}
|
||||
|
||||
protected override void Exporting(PublishLaterPart part, ExportContentContext context) {
|
||||
|
||||
Reference in New Issue
Block a user