コード例 #1
0
        public void RefreshCurrentAccessToken(
            FacebookDelegate <IAccessTokenRefreshResult> callback)
        {
            if (callback == null)
            {
                return;
            }

            var result = new Dictionary <string, object>()
            {
                { Constants.CallbackIdKey, this.CallbackManager.AddFacebookDelegate(callback) }
            };

            if (AccessToken.CurrentAccessToken == null)
            {
                result[Constants.ErrorKey] = "No current access token";
            }
            else
            {
                var accessTokenDic = (IDictionary <string, object>)MiniJSON.Json.Deserialize(
                    AccessToken.CurrentAccessToken.ToJson());

                result.AddAllKVPFrom(accessTokenDic);
            }

            this.OnRefreshCurrentAccessTokenComplete(new ResultContainer(result));
        }
コード例 #2
0
        public void RefreshCurrentAccessToken(FacebookDelegate <IAccessTokenRefreshResult> callback)
        {
            if (callback == null)
            {
                return;
            }
            Dictionary <string, object> dictionary = new Dictionary <string, object>
            {
                {
                    "callback_id",
                    base.CallbackManager.AddFacebookDelegate <IAccessTokenRefreshResult>(callback)
                }
            };

            if (AccessToken.CurrentAccessToken == null)
            {
                dictionary["error"] = "No current access token";
            }
            else
            {
                IDictionary <string, object> source = (IDictionary <string, object>)Json.Deserialize(AccessToken.CurrentAccessToken.ToJson());
                dictionary.AddAllKVPFrom(source);
            }
            this.OnRefreshCurrentAccessTokenComplete(new ResultContainer(dictionary));
        }
コード例 #3
0
        public static IDictionary <string, object> GetResultDictionary(int requestID, IDictionary <string, object> extras)
        {
            var result = new Dictionary <string, object>()
            {
                { Constants.CallbackIdKey, requestID.ToString() }
            };

            if (extras != null)
            {
                result.AddAllKVPFrom(extras);
            }

            return(result);
        }
コード例 #4
0
        protected IDictionary <string, object> GetResultDictionary(int requestId)
        {
            var result = new Dictionary <string, object>()
            {
                { Constants.CallbackIdKey, requestId.ToString() }
            };

            var extras = this.ResultExtras;

            if (extras != null)
            {
                result.AddAllKVPFrom(extras);
            }

            return(result);
        }
コード例 #5
0
        public static IDictionary<string, object> GetResultDictionary(int requestID, IDictionary<string, object> extras)
        {
            var result = new Dictionary<string, object>()
            {
                { Constants.CallbackIdKey, requestID.ToString() }
            };

            if (extras != null)
            {
                result.AddAllKVPFrom(extras);
            }

            return result;
        }
コード例 #6
0
ファイル: EditorFacebook.cs プロジェクト: Cube219/BlockBuster
        public void RefreshCurrentAccessToken(
            FacebookDelegate<IAccessTokenRefreshResult> callback)
        {
            if (callback == null)
            {
                return;
            }

            var result = new Dictionary<string, object>()
            {
                { Constants.CallbackIdKey, this.CallbackManager.AddFacebookDelegate(callback) }
            };

            if (AccessToken.CurrentAccessToken == null)
            {
                result[Constants.ErrorKey] = "No current access token";
            }
            else
            {
                var accessTokenDic = (IDictionary<string, object>)MiniJSON.Json.Deserialize(
                    AccessToken.CurrentAccessToken.ToJson());

                result.AddAllKVPFrom(accessTokenDic);
            }

            this.OnRefreshCurrentAccessTokenComplete(new ResultContainer(result));
        }
コード例 #7
0
        protected IDictionary<string, object> GetResultDictionary(int requestId)
        {
            var result = new Dictionary<string, object>()
            {
                { Constants.CallbackIdKey, requestId.ToString() }
            };

            var extras = this.ResultExtras;
            if (extras != null)
            {
                result.AddAllKVPFrom(extras);
            }

            return result;
        }