public IDataTypeDefinition Import(XElement node, bool forceUpdate = false) { var name = node.Name.LocalName; if (name != "DataType") { throw new ArgumentException("Import only imports single DataTypes"); } if (!forceUpdate) { LogHelper.Debug <uSyncDataType>(">> Checking Hash values"); if (!ChangeTracker.DataTypeChanged(node)) { return(null); } } var _packagingService = ApplicationContext.Current.Services.PackagingService; var _dataTypeService = ApplicationContext.Current.Services.DataTypeService; // import the datatypes // the return value isn't really to be trusted (only returns on a create?) var datatypes = _packagingService.ImportDataTypeDefinitions(node); // packaging service - only creates new stuff // we need to update package values ourselfs. var def = node.Attribute("Definition"); if (def != null) { var dataTypeDefinitionId = new Guid(def.Value); var definition = _dataTypeService.GetDataTypeDefinitionById(dataTypeDefinitionId); if (definition != null) { LogHelper.Debug <uSyncDataType>(">> Going node hunting"); } // Node Hunting (replacing IDs of source to our target) var cNode = HuntContentNodes(node); // update LogHelper.Debug <uSyncDataType>(">> Updating preValues"); UpdatePreValues(definition, node); return(definition); } if (datatypes != null) { return(datatypes.FirstOrDefault()); } return(null); }