コード例 #1
0
        public SA_FBGraphFirendsListResult(IGraphResult graphResult) : base(graphResult)
        {
            if (m_error == null)
            {
                try {
                    IDictionary JSON  = Json.Deserialize(RawResult) as IDictionary;
                    IDictionary f     = JSON[FriendsListKey] as IDictionary;
                    IList       flist = f["data"] as IList;


                    for (int i = 0; i < flist.Count; i++)
                    {
                        SA_FB_User user = new SA_FB_User(flist[i] as IDictionary);
                        m_users.Add(user);
                    }
                } catch (System.Exception ex) {
                    m_error = SA_FB_ErrorFactory.GenerateErrorWithCode(SA_FB_ErrorCode.ParsingFailed, ex.Message);
                }
            }
        }
コード例 #2
0
        protected SA_Error GetResultError(IResult graphResult)
        {
            if (graphResult == null)
            {
                return(SA_FB_ErrorFactory.GenerateErrorWithCode(SA_FB_ErrorCode.NullResult));
            }

            if (graphResult.Cancelled)
            {
                return(SA_FB_ErrorFactory.GenerateErrorWithCode(SA_FB_ErrorCode.UserCanceled));
            }

            if (!string.IsNullOrEmpty(graphResult.Error))
            {
                return(SA_FB_ErrorFactory.GenerateErrorWithCode(SA_FB_ErrorCode.APIError, graphResult.Error));
            }

            if (string.IsNullOrEmpty(graphResult.RawResult))
            {
                return(SA_FB_ErrorFactory.GenerateErrorWithCode(SA_FB_ErrorCode.EmptyRawResult));
            }

            return(null);
        }