public static GetObjectForType ( Microsoft.Synchronization.Services.Formatters.EntryInfoWrapper wrapper, |
||
wrapper | Microsoft.Synchronization.Services.Formatters.EntryInfoWrapper | |
knownTypes | ||
return | IOfflineEntity |
/// <summary> /// Get the conflict item /// </summary> /// <returns>Conflict item</returns> public virtual Conflict GetConflict() { if (!HasConflict()) { return(null); } Conflict conflict; if (currentEntryWrapper.IsConflict) { conflict = new SyncConflict { LiveEntity = liveEntity, LosingEntity = ReflectionUtility.GetObjectForType(currentEntryWrapper.ConflictWrapper, knownTypes), Resolution = (SyncConflictResolution) Enum.Parse(FormatterConstants.SyncConflictResolutionType, currentEntryWrapper.ConflictDesc, true) }; } else { conflict = new SyncError { LiveEntity = liveEntity, ErrorEntity = ReflectionUtility.GetObjectForType(currentEntryWrapper.ConflictWrapper, knownTypes), Description = currentEntryWrapper.ConflictDesc }; } return(conflict); }
/// <summary> /// Returns the current entry element casted as an IOfflineEntity element /// </summary> /// <returns>Typed entry element</returns> public override IOfflineEntity GetItem() { CheckItemType(ReaderItemType.Entry); // Get the type name and the list of properties. currentEntryWrapper = new AtomEntryInfoWrapper((XElement)XNode.ReadFrom(reader)); liveEntity = ReflectionUtility.GetObjectForType(currentEntryWrapper, this.knownTypes); return(liveEntity); }