Exemplo n.º 1
0
        void response(string from_jid, cs_zkrobot.RequestToken token, string result, string options)
        {
            if (token.command() == "list_conferences")
            {
                if (result == "ok")
                {
                    // cids=1,2&
                    List <int> cids = null;

                    string sp = get_kv(options, "cids");
                    if (sp != null)
                    {
                        string[] ss = sp.Split(new char[] { ',' });
                        cids = new List <int>();
                        foreach (string s in ss)
                        {
                            try {
                                int cid = int.Parse(s);
                                cids.Add(cid);
                            }
                            catch { }
                        }
                    }

                    ((delegate_list_conference_result)token.userdata())(cids);
                }
                else
                {
                    // TODO: 错误处理
                    ((delegate_list_conference_result)token.userdata())(null);
                }
            }
            else if (token.command() == "info_conference")
            {
                if (result == "ok")
                {
                    string sp = get_kv(options, "info");
                    ((delegate_info_conference_result)token.userdata())(sp);
                }
                else
                {
                    // TODO: 错误处理 ...
                    ((delegate_info_conference_result)token.userdata())(null);
                }
            }
            else
            {
                // TODO: 更多的 ....
            }
        }
Exemplo n.º 2
0
 static void cb_response(string from_jid, cs_zkrobot.RequestToken token, string result, string options)
 {
     System.Console.WriteLine("res: from:" + from_jid + ", result=" + result + ", options=" + options);
     System.Threading.AutoResetEvent evt = (System.Threading.AutoResetEvent)token.userdata();
     evt.Set();
 }