示例#1
0
文件: LoginBS.cs 项目: dsm0709/wp
        /// <summary>
        /// 解析用户信息
        /// </summary>
        /// <param name="result">数据</param>
        private void DecoderUserInfo(string result)
        {
            try
            {
                UserList userlist = new UserList();
                userlist.User_List = (ObservableCollection <UserDetails>)JsonUtility.DeserializeObj(
                    new MemoryStream(Encoding.UTF8.GetBytes(result)), typeof(ObservableCollection <UserDetails>));
                RenrenSDK.RenrenInfo.SetDetailInfo(userlist.User_List[0]);
            }
            catch
            {
                NotifyError("encoding error");
                return;
            }

            if (LoginCompleted != null)
            {
                System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate()
                {
                    LoginCompleted(this, new LoginCompletedEventArgs("success"));
                });
            }
        }
示例#2
0
 /// <summary>
 /// 构造
 /// </summary>
 public GetUserInfoBS()
 {
     getCurUserInfoRequest = new GetCurUserInfoRequest();
     getUserInfoRequest    = new GetUserInfoRequest();
     userlist = new UserList();
 }
示例#3
0
        /// <summary>
        /// 解析用户信息
        /// </summary>
        /// <param name="result">数据</param>
        private void DecoderUserInfo(string result)
        {
            try
            {
                UserList userlist = new UserList();
                userlist.User_List = (ObservableCollection<UserDetails>)JsonUtility.DeserializeObj(
                    new MemoryStream(Encoding.UTF8.GetBytes(result)), typeof(ObservableCollection<UserDetails>));
                RenrenSDK.RenrenInfo.SetDetailInfo(userlist.User_List[0]);
            }
            catch
            {
                NotifyError("encoding error");
                return;
            }

            if (LoginCompleted != null)
            {
                System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate()
                {
                    LoginCompleted(this, new LoginCompletedEventArgs("success"));
                });
            }
        }
 /// <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 GetUsersCompletedEventArgs(UserList result)
 {
     Result = result;
 }
示例#5
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 GetUsersCompletedEventArgs(UserList result)
 {
     Result = result;
 }
        UserList userlist; //获得的User数据

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 构造
        /// </summary>
        public GetUserInfoBS()
        {
            getCurUserInfoRequest = new GetCurUserInfoRequest();
            getUserInfoRequest = new GetUserInfoRequest();
            userlist = new UserList();
        }
 /// <summary>
 /// 通知查找用户成功信息
 /// </summary>
 /// <param name="msg">内容</param>
 private void GetUsersNotifyMessage(UserList msg)
 {
     if (GetUserInfoCompleted != null)
     {
         System.Windows.Deployment.Current.Dispatcher.BeginInvoke(delegate()
         {
             GetUserInfoCompleted(this, new GetUsersCompletedEventArgs(msg));
         });
     }
 }