Esempio n. 1
0
 internal static extern void nim_nos_upload_ex(
     [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string local_file,
     [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringMarshaler))] string json_extension,
     UploadCb res_cb, IntPtr res_user_data,
     UploadPrgCb prg_cb, IntPtr prg_user_data,
     UploadSpeedCb speed_cb, IntPtr speed_user_data,
     UploadInfoCb info_cb, IntPtr info_user_data);
Esempio n. 2
0
        /// <summary>
        /// 上传资源(扩展)
        /// </summary>
        /// <param name="localFile">本地文件的完整路径</param>
        /// <param name="param">扩展参数</param>
        /// <param name="resCb"></param>
        /// <param name="resData"></param>
        /// <param name="prgCb"></param>
        /// <param name="prgData"></param>
        /// <param name="speedCb"></param>
        /// <param name="speedData"></param>
        /// <param name="infoCb"></param>
        /// <param name="infoData"></param>
        public static void UploadEx(string localFile,
                                    HttpExtendedParameters param,
                                    UploadCb resCb, IntPtr resData,
                                    UploadPrgCb prgCb, IntPtr prgData,
                                    UploadSpeedCb speedCb, IntPtr speedData,
                                    UploadInfoCb infoCb, IntPtr infoData)
        {
            CallbackDataPair resPair   = new CallbackDataPair(resCb, resData);
            CallbackDataPair prgPair   = new CallbackDataPair(prgCb, prgData);
            CallbackDataPair speedPair = new CallbackDataPair(speedCb, speedData);
            CallbackDataPair infoPair  = new CallbackDataPair(infoCb, infoData);

            NosNativeMethods.nim_nos_upload_ex(localFile,
                                               param != null ? param.Serialize() : string.Empty,
                                               UploadCallbackEx, resPair.ToIntPtr(),
                                               UploadPrgCallbackEx, prgPair.ToIntPtr(),
                                               UploadSpeedCallbackEx, speedPair.ToIntPtr(),
                                               UploadInfoCallbackEx, infoPair.ToIntPtr());
        }
Esempio n. 3
0
        /// <summary>
        /// (全局回调)注册上传回调,通过注册回调获得HTTP上传结果通知(所有触发HTTP上传任务的接口的参数列表里无法设置通知回调处理函数的通知都走这个通知,比如发送文件图片语音消息等)
        /// </summary>
        /// <param name="callback"></param>
        /// <param name="data"></param>
        public static void RegisterDefaultUploadCallback(UploadCb callback, IntPtr data)
        {
            CallbackDataPair pair = new CallbackDataPair(callback, data);

            NosNativeMethods.nim_nos_reg_upload_cb(UploadCallbackEx, pair.ToIntPtr());
        }
Esempio n. 4
0
 internal static extern void nim_nos_upload([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NimUtility.Utf8StringMarshaler))] string local_file,
                                            UploadCb res_cb, IntPtr res_user_data, UploadPrgCb prg_cb, IntPtr prg_user_data);
Esempio n. 5
0
 internal static extern void nim_nos_reg_upload_cb(UploadCb cb, IntPtr user_data);