Beispiel #1
0
        /// <summary>
        /// 更新好友资料
        /// </summary>
        /// <param name="profile"></param>
        /// <param name="cb"></param>
        public static void UpdateFriendInfo(NIMFriendProfile profile, FriendOperationDelegate cb)
        {
            if (profile == null || string.IsNullOrEmpty(profile.AccountId))
            {
                throw new ArgumentException("profile or accountid can't be null");
            }
            string jsonParam = profile.Serialize();

            FriendNativeMethods.nim_friend_update(jsonParam, null, cb, IntPtr.Zero);
        }
Beispiel #2
0
        /// <summary>
        ///     更新好友资料
        /// </summary>
        /// <param name="profile"></param>
        /// <param name="cb"></param>
        public static void UpdateFriendInfo(NIMFriendProfile profile, FriendOperationDelegate cb)
        {
            if (profile == null || string.IsNullOrEmpty(profile.AccountId))
            {
                throw new ArgumentException("profile or accountid can't be null");
            }
            var    jsonParam = profile.Serialize();
            IntPtr ptr       = DelegateConverter.ConvertToIntPtr(cb);

            FriendNativeMethods.nim_friend_update(jsonParam, null, UpdateFriendDelegate, ptr);
        }
Beispiel #3
0
 private static void OnGetFriendProfileCompleted(string accid, string profileJson, string jsonExtension, IntPtr userData)
 {
     if (userData != IntPtr.Zero)
     {
         NIMFriendProfile profile = null;
         if (!string.IsNullOrEmpty(profileJson))
         {
             profile = NIMFriendProfile.Deserialize(profileJson);
         }
         NimUtility.DelegateConverter.Invoke <GetFriendProfileResultDelegate>(userData, accid, profile);
     }
 }