private Dictionary <string, object> getItemUpdates(AccountWin account, Guid identifier, List <ChangedProperty> changedProperties) { BaseItemWin item = account.Find(identifier); if (item == null) { return(null); } if (changedProperties.Any(i => i.PropertyName == BaseItemWin.PropertyNames.All)) { foreach (ChangedProperty p in changedProperties) { p.HasBeenSent = true; } return(item.SerializeToDictionary()); } Dictionary <string, object> answer = new Dictionary <string, object>(); answer["Identifier"] = identifier; answer["Updated"] = item.Updated; foreach (ChangedProperty p in changedProperties) { answer[p.PropertyName.ToString()] = item.GetPropertyValue(p.PropertyName); p.HasBeenSent = true; } return(answer); }
internal override void Add(BaseItemWin item) { throw new NotImplementedException(); }
internal override void Remove(BaseItemWin item) { //should never be called throw new NotImplementedException(); }
private ChangedItem grabIndex(BaseItemWin item) { return(grabIndex(item.Identifier)); }
/// <summary> /// Adds to Updated and removes from Deleted /// </summary> /// <param name="item"></param> public void Add(BaseItemWin item) { ChangedItem index = grabIndex(item); index.SetUpdated(); }