Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 internal override void Add(BaseItemWin item)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 3
0
 internal override void Remove(BaseItemWin item)
 {
     //should never be called
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 private ChangedItem grabIndex(BaseItemWin item)
 {
     return(grabIndex(item.Identifier));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Adds to Updated and removes from Deleted
        /// </summary>
        /// <param name="item"></param>
        public void Add(BaseItemWin item)
        {
            ChangedItem index = grabIndex(item);

            index.SetUpdated();
        }