Exemplo n.º 1
0
        /// <summary>Record the new Item created event</summary>
        internal static void Record(Root root, Item item)
        {
            var cs = root.Get <ChangeRoot>().ChangeSet;

            string name  = item.GetChangeLogId(root);
            var    store = item.Owner as Store;

            new ItemCreated(cs, item, store.IndexOf(item), name);
        }
Exemplo n.º 2
0
 internal static void Record(Root root, Item itm, Property prop, string newValue)
 {
     itm.ModelDelta++;
     if (prop.IsCovert)
     {
         prop.Value.SetString(itm, newValue);
     }
     else
     {
         var oldValue = prop.Value.GetString(itm);
         var name     = $"{itm.GetChangeLogId()}    {prop.GetNameId()}:  old<{oldValue}>  new<{newValue}>";
         if (prop.Value.SetString(itm, newValue))
         {
             new ItemUpdated(root.Get <ChangeManager>().ChangeSet, itm, prop, oldValue, newValue, name);
         }
     }
 }
Exemplo n.º 3
0
        internal static void Record(ChangeSet owner, Root root, Item item)
        {
            var inx  = item.Index;
            var name = item.GetChangeLogId();

            if (root.Get <Relation_Store_ColumnX>().TryGetChildren(owner, out IList <ColumnX> cols))
            {
                var vals = new List <string>(cols.Count);
                foreach (var col in cols)
                {
                    vals.Add(col.Value.GetString(item));
                }
                new ItemRemoved(owner, item, inx, name, cols, vals);
            }
            else
            {
                new ItemRemoved(owner, item, inx, name);
            }
        }