public void renren_GetCurUserInfoCompletedHandler(object sender,GetUserUidCompletedEventArgs  e)
        {
            disableRect.Visibility = Visibility.Collapsed;
            down_Bar.Visibility = Visibility.Collapsed;
            down_TBlk.Visibility = Visibility.Collapsed;

            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);
                NavigationService.GoBack();
            }
            else
            {
                UserDetails user = new UserDetails();
                user = e.Result;
                ObservableCollection<UserDetails> User_List = new ObservableCollection<UserDetails>() { user };

                UserList_Box.ItemsSource = User_List;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 构造
 /// </summary>
 public RenrenAppInfo()
 {
     if (!settings.TryGetValue<TokenInfo>(tokenInfoKey, out tokenInfo))
     {
         tokenInfo = new TokenInfo();
     }
     if (!settings.TryGetValue<UserDetails>(detailInfoKey, out detailInfo))
     {
         detailInfo = new UserDetails();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 设置详细信息
 /// </summary>
 /// <param name="info">信息</param>
 public void SetDetailInfo(UserDetails info)
 {
     if (info == null)
         return;
     detailInfo = info;
     if (!settings.Contains(detailInfoKey))
     {
         settings.Add(detailInfoKey, detailInfo);
     }
     else
     {
         settings[detailInfoKey] = detailInfo;
     }
 }
Esempio n. 4
0
 /// <summary>
 /// 清除信息
 /// </summary>
 public void CleanUp()
 {
     tokenInfo.CleanUp();
     detailInfo = null;
     if (settings.Contains(tokenInfoKey))
         settings.Remove(tokenInfoKey);
     if (settings.Contains(detailInfoKey))
         settings.Remove(detailInfoKey);
 }
 /// <summary>
 /// Creates a new instance of DownloadStringCompletedEventArgs with the specified result data.
 /// </summary>
 /// <param name="result">The data that is downloaded by a DownloadStringAsync method.</param>
 public GetUserUidCompletedEventArgs(UserDetails result)
 {
     Result = result;
 }
Esempio n. 6
0
 /// <summary>
 /// Creates a new instance of DownloadStringCompletedEventArgs with the specified result data.
 /// </summary>
 /// <param name="result">The data that is downloaded by a DownloadStringAsync method.</param>
 public GetUserUidCompletedEventArgs(UserDetails result)
 {
     Result = result;
 }
 /// <summary>
 /// 通知查找当前用户uid成功信息
 /// </summary>
 /// <param name="msg">内容</param>
 private void GetUidNotifyMessage(UserDetails msg)
 {
     if (GetCurUserInfoCompleted != null)
     {
         System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate()
         {
             GetCurUserInfoCompleted(this, new GetUserUidCompletedEventArgs(msg));
         });
     }
 }
        /// <summary>
        /// 获取当前用户信息回调
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DecocerCurUser(string result)
        {
            UserDetails oneuid = new UserDetails();
            try
            {
                oneuid = (UserDetails)JsonUtility.DeserializeObj(
                    new MemoryStream(Encoding.UTF8.GetBytes(result)), typeof(UserDetails));
            }
            catch
            {
                GetUidNotifyError("encoding error");
                return;
            }

            GetUidNotifyMessage(oneuid);
        }
Esempio n. 9
0
 // 此处的目的是试探到底人人帐号的信息有没有过期
 // 因为即使过期了,一开始加载的数据还是从IsolatedStorage中拉取的
 // 用户会误认为当前登陆仍然有效
 // 绝大多数情况下这一些得到的数据和构造函数中得到的数据应该是完全一样的
 // 之所以构造函数里那一块不删,是为了使用户加载页面时不显得卡顿
 private void RefreshRealData()
 {
     api.GetCurUserInfo((e1 , e) =>
     {
         if (e.Error != null)
         {
             CurrentNickName = "未登陆";
             CurrentAvatar = "";
         }
         else
         {
             UserDetails user = new UserDetails();
             user = e.Result;
             CurrentNickName = user.name;
             CurrentAvatar = user.headurl;
             PreferenceHelper.SetPreference("Renren_Avatar", user.headurl);
             PreferenceHelper.SetPreference("Renren_NickName", user.name);
             PreferenceHelper.SetPreference("Renren_ID", user.uid.ToString());
         }
     });
 }
Esempio n. 10
0
 public void renren_GetCurUserInfoCompletedHandler(object sender, GetUserUidCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         MessageBox.Show(e.Error.Message);
         NavigationService.GoBack();
     }
     else
     {
         UserDetails user = new UserDetails();
         user = e.Result;
         CurrentNickName = user.name;
         CurrentAvatar = user.headurl;
         PreferenceHelper.SetPreference("Renren_Avatar", user.headurl);
         PreferenceHelper.SetPreference("Renren_NickName", user.name);
         PreferenceHelper.SetPreference("Renren_ID", user.uid.ToString());
     }
 }