Esempio n. 1
0
        public void GetJoinedGroupsFromServerCallback(string jsonParam)
        {
            JsonData        jsonData   = JsonMapper.ToObject(jsonParam);
            int             callbackId = (int)jsonData ["callbackid"];
            string          on         = (string)jsonData ["on"];
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                List <EMGroup> groups = EMTools.json2grouplist((string)jsonData ["data"]);
                cb.onSuccessGetGroupListCallback(groups);
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback((int)jsonData ["code"], (string)jsonData ["message"]);
            }
        }
Esempio n. 2
0
        public void GetJoinedGroupsFromServerCallback(string jsonParam)
        {
            JSONNode        jsonData   = JSON.Parse(jsonParam);
            int             callbackId = jsonData ["callbackid"].AsInt;
            string          on         = jsonData ["on"].Value;
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                List <EMGroup> groups = EMTools.json2grouplist(jsonData ["data"].Value);
                cb.onSuccessGetGroupListCallback(groups);
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback(jsonData ["code"].AsInt, jsonData ["message"].Value);
            }
        }
Esempio n. 3
0
        public List <EMGroup> getAllGroups()
        {
            string jsondata = sdk.getAllGroups();

            return(EMTools.json2grouplist(jsondata));
        }