예제 #1
0
        /// <summary>
        /// 注册服务端指令接受时的代理
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="hanlder"></param>
        internal void RegisterNotice <T>(Action <T> hanlder)
            where T : AVIMNotice
        {
            var typeName          = AVIMNotice.GetNoticeTypeName <T>();
            Action <AVIMNotice> b = (target) =>
            {
                hanlder((T)target);
            };

            noticeHandlers[typeName] = b;
        }
예제 #2
0
        static AVIMClient()
        {
            Type platformHookType = GetAVType("AVIMPlatformHooks");

            if (platformHookType == null)
            {
                throw new InvalidOperationException("You must include a reference to a platform-specific LeanCloud library.");
            }
            platformHooks = Activator.CreateInstance(platformHookType) as IAVIMPlatformHooks;
            commandRunner = new AVIMCommandRunner(platformHooks.WebSocketClient);

            AVIMNotice.RegisterInterface <AVIMMessageNotice>(new AVIMMessageNotice());
        }