Example #1
0
        /// <summary>
        /// 请求用户列表。异步,此方法将请求放入请求队列后返回。
        /// </summary>
        /// <param name="callback">数据发送完毕时回调函数。</param>
        /// <returns>成功将请求加入发送队列返回true,否则返回false。</returns>
        public static bool QueueGetUserList(Action <ResultHead> callback = null)
        {
            BaseHead jsonObj = new BaseHead()
            {
                Token     = "",
                Operation = Operations.GetUsers,
            };
            Packet packet = new Packet
            {
                Head     = jsonObj,
                Data     = null,
                CallBack = callback
            };

            return(Send(packet));
        }
Example #2
0
        /// <summary>
        /// 请求登出。异步,此方法将请求放入请求队列后返回。
        /// </summary>
        /// <param name="callback">数据发送完毕时回调函数。</param>
        /// <returns>成功将请求加入发送队列返回true,否则返回false。</returns>
        public static bool QueueLogout(Action <ResultHead> callback = null)
        {
            BaseHead jsonObj = new BaseHead()
            {
                Token     = "",
                Operation = Operations.Logout,
            };
            Packet packet = new Packet
            {
                Head     = jsonObj,
                Data     = null,
                CallBack = callback
            };
            bool success = Send(packet);

            SetStatus(ClientStatus.Stopped);
            return(success);
        }