Exemple #1
0
        static MapAttr convertFromMsgPackObjectDictionary(MsgPack.MessagePackObjectDictionary mpobj)
        {
            MapAttr t = new MapAttr();

            MsgPack.MessagePackObjectDictionary.Enumerator e = mpobj.GetEnumerator();
            while (e.MoveNext())
            {
                MsgPack.MessagePackObject key = e.Current.Key;
                MsgPack.MessagePackObject val = e.Current.Value;
                t.put(key.AsString(), convertFromMsgPackObject(val));
            }
            return(t);
        }
        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]);
            }
        }