@@ -74,7 +74,7 @@ public PackagingService(IContentService contentService,
74
74
public XElement Export ( IContent content , bool deep = false , bool raiseEvents = true )
75
75
{
76
76
var nodeName = UmbracoConfig . For . UmbracoSettings ( ) . Content . UseLegacyXmlSchema ? "node" : content . ContentType . Alias . ToSafeAliasWithForcingCheck ( ) ;
77
-
77
+
78
78
if ( raiseEvents )
79
79
{
80
80
if ( ExportingContent . IsRaisedEventCancelled ( new ExportEventArgs < IContent > ( content , nodeName ) , this ) )
@@ -84,13 +84,13 @@ public XElement Export(IContent content, bool deep = false, bool raiseEvents = t
84
84
var exporter = new EntityXmlSerializer ( ) ;
85
85
var xml = exporter . Serialize ( _contentService , _dataTypeService , content , deep ) ;
86
86
87
- if ( raiseEvents )
87
+ if ( raiseEvents )
88
88
ExportedContent . RaiseEvent ( new ExportEventArgs < IContent > ( content , xml , false ) , this ) ;
89
89
90
90
return xml ;
91
91
}
92
92
93
-
93
+
94
94
95
95
/// <summary>
96
96
/// Imports and saves package xml as <see cref="IContent"/>
@@ -107,7 +107,7 @@ public IEnumerable<IContent> ImportContent(XElement element, int parentId = -1,
107
107
if ( ImportingContent . IsRaisedEventCancelled ( new ImportEventArgs < IContent > ( element ) , this ) )
108
108
return Enumerable . Empty < IContent > ( ) ;
109
109
}
110
-
110
+
111
111
var name = element . Name . LocalName ;
112
112
if ( name . Equals ( "DocumentSet" ) )
113
113
{
@@ -120,7 +120,7 @@ public IEnumerable<IContent> ImportContent(XElement element, int parentId = -1,
120
120
if ( contents . Any ( ) )
121
121
_contentService . Save ( contents , userId ) ;
122
122
123
- if ( raiseEvents )
123
+ if ( raiseEvents )
124
124
ImportedContent . RaiseEvent ( new ImportEventArgs < IContent > ( contents , element , false ) , this ) ;
125
125
return contents ;
126
126
}
@@ -134,7 +134,7 @@ public IEnumerable<IContent> ImportContent(XElement element, int parentId = -1,
134
134
if ( contents . Any ( ) )
135
135
_contentService . Save ( contents , userId ) ;
136
136
137
- if ( raiseEvents )
137
+ if ( raiseEvents )
138
138
ImportedContent . RaiseEvent ( new ImportEventArgs < IContent > ( contents , element , false ) , this ) ;
139
139
return contents ;
140
140
}
@@ -248,7 +248,7 @@ where property.Attribute("isDoc") == null
248
248
249
249
//TODO: We need to refactor this so the packager isn't making direct db calls for an 'edge' case
250
250
var database = ApplicationContext . Current . DatabaseContext . Database ;
251
- var dtos = database . Fetch < DataTypePreValueDto > ( "WHERE datatypeNodeId = @Id" , new { Id = propertyType . DataTypeDefinitionId } ) ;
251
+ var dtos = database . Fetch < DataTypePreValueDto > ( "WHERE datatypeNodeId = @Id" , new { Id = propertyType . DataTypeDefinitionId } ) ;
252
252
253
253
var propertyValueList = new List < string > ( ) ;
254
254
foreach ( var preValue in propertyValue . Split ( ',' ) )
@@ -261,7 +261,7 @@ where property.Attribute("isDoc") == null
261
261
}
262
262
263
263
//set property value
264
- content . SetValue ( propertyTypeAlias , propertyValue ) ;
264
+ content . SetValue ( propertyTypeAlias , propertyValue ) ;
265
265
}
266
266
}
267
267
}
@@ -491,13 +491,13 @@ private void UpdateContentTypesTabs(IContentType contentType, XElement tabElemen
491
491
{
492
492
contentType . AddPropertyGroup ( caption ) ;
493
493
494
- int sortOrder ;
495
- if ( tab . Element ( "SortOrder" ) != null &&
496
- int . TryParse ( tab . Element ( "SortOrder" ) . Value , out sortOrder ) )
497
- {
498
- // Override the sort order with the imported value
499
- contentType . PropertyGroups [ caption ] . SortOrder = sortOrder ;
500
- }
494
+ }
495
+
496
+ int sortOrder ;
497
+ if ( tab . Element ( "SortOrder" ) != null && int . TryParse ( tab . Element ( "SortOrder" ) . Value , out sortOrder ) )
498
+ {
499
+ // Override the sort order with the imported value
500
+ contentType . PropertyGroups [ caption ] . SortOrder = sortOrder ;
501
501
}
502
502
}
503
503
}
@@ -549,7 +549,7 @@ private void UpdateContentTypesProperties(IContentType contentType, XElement gen
549
549
dataTypeDefinition = dataTypeDefinitions . First ( ) ;
550
550
}
551
551
}
552
-
552
+
553
553
// For backwards compatibility, if no datatype with that ID can be found, we're letting this fail silently.
554
554
// This means that the property will not be created.
555
555
if ( dataTypeDefinition == null )
@@ -786,15 +786,15 @@ private void SavePrevaluesFromXml(List<IDataTypeDefinition> dataTypes, IEnumerab
786
786
var dataTypeDefinition = dataTypes . First ( x => x . Name == dataTypeDefinitionName ) ;
787
787
788
788
var valuesWithoutKeys = prevaluesElement . Elements ( "PreValue" )
789
- . Where ( x => ( ( string ) x . Attribute ( "Alias" ) ) . IsNullOrWhiteSpace ( ) )
789
+ . Where ( x => ( ( string ) x . Attribute ( "Alias" ) ) . IsNullOrWhiteSpace ( ) )
790
790
. Select ( x => x . Attribute ( "Value" ) . Value ) ;
791
791
792
792
var valuesWithKeys = prevaluesElement . Elements ( "PreValue" )
793
- . Where ( x => ( ( string ) x . Attribute ( "Alias" ) ) . IsNullOrWhiteSpace ( ) == false )
793
+ . Where ( x => ( ( string ) x . Attribute ( "Alias" ) ) . IsNullOrWhiteSpace ( ) == false )
794
794
. ToDictionary (
795
- key => ( string ) key . Attribute ( "Alias" ) ,
796
- val => new PreValue ( ( string ) val . Attribute ( "Value" ) ) ) ;
797
-
795
+ key => ( string ) key . Attribute ( "Alias" ) ,
796
+ val => new PreValue ( ( string ) val . Attribute ( "Value" ) ) ) ;
797
+
798
798
//save the values with keys
799
799
_dataTypeService . SavePreValues ( dataTypeDefinition , valuesWithKeys ) ;
800
800
@@ -841,7 +841,7 @@ public XElement Export(IDictionaryItem dictionaryItem, bool includeChildren, boo
841
841
842
842
var exporter = new EntityXmlSerializer ( ) ;
843
843
var xml = exporter . Serialize ( dictionaryItem ) ;
844
-
844
+
845
845
if ( includeChildren )
846
846
{
847
847
var children = _localizationService . GetDictionaryItemChildren ( dictionaryItem . Key ) ;
@@ -1115,7 +1115,7 @@ private IMacro ParseMacroElement(XElement macroElement)
1115
1115
dontRender = bool . Parse ( dontRenderElement . Value ) ;
1116
1116
}
1117
1117
1118
- var existingMacro = _macroService . GetByAlias ( macroAlias ) as Macro ;
1118
+ var existingMacro = _macroService . GetByAlias ( macroAlias ) as Macro ;
1119
1119
var macro = existingMacro ?? new Macro ( macroAlias , macroName , controlType , controlAssembly , xsltPath , scriptPath ,
1120
1120
cacheByPage , cacheByMember , dontRender , useInEditor , cacheDuration ) ;
1121
1121
@@ -1210,7 +1210,7 @@ public XElement Export(IMember member)
1210
1210
public XElement Export ( IMedia media , bool deep = false , bool raiseEvents = true )
1211
1211
{
1212
1212
var nodeName = UmbracoConfig . For . UmbracoSettings ( ) . Content . UseLegacyXmlSchema ? "node" : media . ContentType . Alias . ToSafeAliasWithForcingCheck ( ) ;
1213
-
1213
+
1214
1214
if ( raiseEvents )
1215
1215
{
1216
1216
if ( ExportingMedia . IsRaisedEventCancelled ( new ExportEventArgs < IMedia > ( media , nodeName ) , this ) )
@@ -1220,7 +1220,7 @@ public XElement Export(IMedia media, bool deep = false, bool raiseEvents = true)
1220
1220
var exporter = new EntityXmlSerializer ( ) ;
1221
1221
var xml = exporter . Serialize ( _mediaService , _dataTypeService , media , deep ) ;
1222
1222
1223
- if ( raiseEvents )
1223
+ if ( raiseEvents )
1224
1224
ExportedMedia . RaiseEvent ( new ExportEventArgs < IMedia > ( media , xml , false ) , this ) ;
1225
1225
1226
1226
return xml ;
@@ -1334,7 +1334,7 @@ public IEnumerable<ITemplate> ImportTemplates(XElement element, int userId = 0,
1334
1334
if ( templates . Any ( ) )
1335
1335
_fileService . SaveTemplate ( templates , userId ) ;
1336
1336
1337
- if ( raiseEvents )
1337
+ if ( raiseEvents )
1338
1338
ImportedTemplate . RaiseEvent ( new ImportEventArgs < ITemplate > ( templates , element , false ) , this ) ;
1339
1339
1340
1340
return templates ;
@@ -1352,10 +1352,10 @@ public IEnumerable<IFile> ImportStylesheets(XElement element, int userId = 0, bo
1352
1352
1353
1353
IEnumerable < IFile > styleSheets = Enumerable . Empty < IFile > ( ) ;
1354
1354
1355
- if ( element . Elements ( ) . Any ( ) )
1355
+ if ( element . Elements ( ) . Any ( ) )
1356
1356
throw new NotImplementedException ( "This needs to be implimentet" ) ;
1357
1357
1358
-
1358
+
1359
1359
if ( raiseEvents )
1360
1360
ImportingStylesheets . RaiseEvent ( new ImportEventArgs < IFile > ( styleSheets , element , false ) , this ) ;
1361
1361
@@ -1480,7 +1480,7 @@ internal MetaData GetPackageMetaData(string packageFilePath)
1480
1480
/// </summary>
1481
1481
public static event TypedEventHandler < IPackagingService , ImportEventArgs < IContent > > ImportedContent ;
1482
1482
1483
-
1483
+
1484
1484
public static event TypedEventHandler < IPackagingService , ExportEventArgs < IContent > > ExportingContent ;
1485
1485
1486
1486
/// <summary>
@@ -1607,7 +1607,7 @@ internal MetaData GetPackageMetaData(string packageFilePath)
1607
1607
/// Occurs before Importing Stylesheets
1608
1608
/// </summary>
1609
1609
public static event TypedEventHandler < IPackagingService , ImportEventArgs < IFile > > ImportingStylesheets ;
1610
-
1610
+
1611
1611
/// <summary>
1612
1612
/// Occurs after Template is Imported and Saved
1613
1613
/// </summary>
@@ -1622,7 +1622,7 @@ internal MetaData GetPackageMetaData(string packageFilePath)
1622
1622
/// Occurs after Template is Exported to Xml
1623
1623
/// </summary>
1624
1624
public static event TypedEventHandler < IPackagingService , ExportEventArgs < ITemplate > > ExportedTemplate ;
1625
-
1625
+
1626
1626
/// <summary>
1627
1627
/// Occurs before Importing umbraco package
1628
1628
/// </summary>
0 commit comments