Exemplo n.º 1
0
        protected override object GenerateParamerte(Type paramType, string value)
        {
            Object obj = null;

            if (typeof(Delegate).IsAssignableFrom(paramType))
            {
                if (paramType == typeof(QueryMsglogResultDelegate))
                {
                    obj = new QueryMsglogResultDelegate(OnQueryMsgLogCompleted);
                }
                else if (paramType == typeof(QueryLogByMsgIdResultDelegate))
                {
                    obj = new QueryLogByMsgIdResultDelegate(OnQueryLogByMsgIdCompleted);
                }
                else if (paramType == typeof(OperateMsglogResultDelegate))
                {
                    obj = new OperateMsglogResultDelegate(OnOperateMsglogCompleted);
                }
                else if (paramType == typeof(OperateSingleLogResultDelegate))
                {
                    obj = new OperateSingleLogResultDelegate(OnOperateSingleLogCompleted);
                }
                else if (paramType == typeof(CommonOperationResultDelegate))
                {
                    obj = new CommonOperationResultDelegate(OnCommonOperationCompleted);
                }
                else if (paramType == typeof(ImportProgressDelegate))
                {
                    obj = new ImportProgressDelegate(ImportProgress);
                }
            }
            else
            {
                obj = base.GenerateParamerte(paramType, value);
            }
            return(obj);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 删除指定一条消息
        /// </summary>
        /// <param name="sid"></param>
        /// <param name="sType"></param>
        /// <param name="msgId"></param>
        /// <param name="action"></param>
        public static void DeleteSpecifiedMsglog(string sid, NIMSessionType sType, string msgId, OperateSingleLogResultDelegate action)
        {
            var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(action);

            MsglogNativeMethods.nim_msglog_delete_async(sid, sType, msgId, null, OperateMsglogByLogIdCompleted, ptr);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 只往本地消息历史数据库里写入一条消息(如果已存在这条消息,则更新。通常是APP的本地自定义消息,并不会发给服务器)
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="sType"></param>
        /// <param name="msgId"></param>
        /// <param name="msg"></param>
        /// <param name="action"></param>
        public static void WriteMsglog(string uid, Session.NIMSessionType sType, string msgId, NIMIMMessage msg, OperateSingleLogResultDelegate action)
        {
            var ptr          = NimUtility.DelegateConverter.ConvertToIntPtr(action);
            var msgJsonValue = msg.Serialize();

            MsglogNativeMethods.nim_msglog_write_db_only_async(uid, sType, msgId, msgJsonValue, null, OperateMsglogByLogIdCompleted, ptr);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 设置消息子状态
        /// </summary>
        /// <param name="msgId"></param>
        /// <param name="status"></param>
        /// <param name="action"></param>
        public static void SetMsglogSubStatus(string msgId, NIMMsgLogSubStatus status, OperateSingleLogResultDelegate action)
        {
            var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(action);

            MsglogNativeMethods.nim_msglog_set_sub_status_async(msgId, status, null, OperateMsglogByLogIdCompleted, ptr);
        }
        public static void WriteMsglogOnlyForTest(string uid, bool need_update_session, NIMIMMessage msg, string json_extension, OperateSingleLogResultDelegate action)
        {
            var ptr          = DelegateConverter.ConvertToIntPtr(action);
            var msgJsonValue = msg.Serialize();

            MsglogNativeMethods.nim_msglog_insert_msglog_async(uid, msgJsonValue, need_update_session, json_extension, OperateMsglogByLogIdCompleted, ptr);
        }