Esempio 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);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据消息ID查询本地(单条)消息
        /// </summary>
        /// <param name="clientMsgId"></param>
        /// <param name="action"></param>
        public static void QuerylogById(string clientMsgId, QueryLogByMsgIdResultDelegate action)
        {
            var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(action);

            MsglogNativeMethods.nim_msglog_query_msg_by_id_async(clientMsgId, null, QuerySingleLogCompleted, ptr);
        }