Exemplo n.º 1
0
        internal void OnListAttrChange(ListAttr path, int index, object val)
        {
            ListAttr l = getAttrByPath(path) as ListAttr;

            l.set(index, val);
            string rootkey = (string)path.get(0);

            System.Reflection.MethodInfo callback = this.GetType().GetMethod("OnAttrChange_" + rootkey);
            if (callback != null)
            {
                callback.Invoke(this, new object[0]);
            }
        }
Exemplo n.º 2
0
        internal void OnMapAttrChange(ListAttr path, string key, object val)
        {
            MapAttr t = this.getAttrByPath(path) as MapAttr;

            t.put(key, val);
            string rootkey = path != null && path.Count > 0 ? (string)path.get(0) : key;

            System.Reflection.MethodInfo callback = this.GetType().GetMethod("OnAttrChange_" + rootkey);
            if (callback != null)
            {
                callback.Invoke(this, new object[0]);
            }
        }
Exemplo n.º 3
0
        internal void OnMapAttrClear(ListAttr path)
        {
            System.Diagnostics.Debug.Assert(path != null && path.Count > 0);
            MapAttr t = this.getAttrByPath(path) as MapAttr;

            t.Clear();
            string rootkey = (string)path.get(0);

            System.Reflection.MethodInfo callback = this.GetType().GetMethod("OnAttrChange_" + rootkey);
            if (callback != null)
            {
                callback.Invoke(this, new object[0]);
            }
        }
Exemplo n.º 4
0
        internal void OnMapAttrDel(ListAttr path, string key)
        {
            MapAttr t = this.getAttrByPath(path) as MapAttr;

            if (t.ContainsKey(key))
            {
                t.Remove(key);
            }
            string rootkey = path != null && path.Count > 0 ? (string)path.get(0) : key;

            System.Reflection.MethodInfo callback = this.GetType().GetMethod("OnAttrChange_" + rootkey);
            if (callback != null)
            {
                callback.Invoke(this, new object[0]);
            }
        }