Esempio n. 1
0
        public void BeginUserRealtimeLinks(BitlyLogin user, RestCallback callback)
        {
            var request = new RestRequest {Path = "user/realtime_links"};
            request.AddParameter("format", "json");
            request.AddParameter("access_token", user.access_token);

            _sslClient.BeginRequest(request, callback);
        }
Esempio n. 2
0
 public bool Validate(BitlyLogin user)
 {
     throw new NotImplementedException();
 }
        private void DownloadUserClicks(BitlyLogin login)
        {
            _bitlyService.BeginUserClicks(login, 7, (request, response, userState) =>
            {
                var userClicks = _bitlyService.EndUserClicks(response);
                Clicks = UserClicksConverter.ExtractClicks(userClicks);

                Dispatcher.BeginInvoke(() =>
                {
                    if (Clicks.GetType() == typeof(MissingBitlyUserClicksResponse))
                    {
                        MessageBox.Show("Unable to download click data from Bit.ly :( ");
                    }
                    else
                    {
                        TotalClicks.Text = "Total Clicks: " + userClicks.data.total_clicks;
                        TotalDays.Text = "Total Days: " + userClicks.data.Days;
                    }

                });
            });
        }
 public void SaveUser(BitlyLogin login)
 {
     IsolatedStorageHelper.SaveApplicationSetting("user", login);
 }
        private void SaveUserAndGotoMain(BitlyLogin login)
        {
            if (login.GetType() == typeof(MissingBitlyLogin))
            {
                Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show("Unable to log you in. Please try again!");
                    HideBrowserUi();
                });

            }
            else
            {
                _repository.SaveUser(login);
                Dispatcher.BeginInvoke(HidePopup);
                DownloadUserClicks(login);
            }
        }