Beispiel #1
0
        void UpdateView()
        {
            var profile = SL.Profile;

            if (profile != null)
            {
                CheckNetworks();
                ScoreImage.Image = UIImage.FromBundle("ob-score-bg");
            }
            else
            {
                ScoreFill.Image  = null;
                ScoreImage.Image = UIImage.FromBundle("SLCircleLogo");
            }

            if (SL.IsNetworkConnected("Facebook"))
            {
                FacebookConnectedImage.Image = UIImage.FromBundle("check-icon_green");
                FacebookLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_fb-connected"), UIControlState.Normal);
            }
            else
            {
                FacebookConnectedImage.Image = null;
                FacebookLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_fb-unconnected"), UIControlState.Normal);
            }

            if (SL.IsNetworkConnected("Twitter"))
            {
                TwitterConnectedImage.Image = UIImage.FromBundle("check-icon_green");
                TwitterLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_twitter-connected"), UIControlState.Normal);
            }
            else
            {
                TwitterConnectedImage.Image = null;
                TwitterLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_twitter-unconnected"), UIControlState.Normal);
            }

            if (SL.IsNetworkConnected("Instagram"))
            {
                InstagramConnectedImage.Image = UIImage.FromBundle("check-icon_green");
                InstagramLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_insta-connected"), UIControlState.Normal);
            }
            else
            {
                InstagramConnectedImage.Image = null;
                InstagramLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_insta-unconnected"), UIControlState.Normal);
            }

            NextButton.Enabled  = SL.HasNetworks;
            LogoutButton.Hidden = SL.NetworkList == null || SL.NetworkList.Count == 0;
        }
Beispiel #2
0
        public void OnOAuthLoginCompleted(LoginTwitterPanel loginTwitter)
        {
            if (loginTwitter.LoginSuccessful)
            {
                MainWindow.Instance.ShowLoadingPanel();

                SocialLoginCompleteLabel.Text = String.Format(
                    SocialLoginCompleteLabel.Text,
                    "Twitter",
                    "Facebook"
                    );

                TwitterLoginButton.Hide();
                SocialLinkWorker.RunWorkerAsync(loginTwitter.TwitterApi);
            }
            else
            {
                SocialLoginErrorLabel.Show();
            }
        }
Beispiel #3
0
        private void SocialLinkWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (FacebookLoginButton.Visible || TwitterLoginButton.Visible)
                {
                    SocialLoginCompleteLabel.Show();

                    MainWindow.Instance.RemoveFromHistory <LoginTwitterPanel>();
                    MainWindow.Instance.RemoveFromHistory <LoginFacebookPanel>();
                    MainWindow.Instance.HideLoadingPanel();
                }
                else
                {
                    MainWindow.Instance.NextPanel <ProfilePanel>();
                }
            }
            else
            {
                if (e.Error is KMSWrongUserCredentials)
                {
                    SocialLoginErrorLabel.Show();

                    if (e.Result is FacebookClient)
                    {
                        FacebookLoginButton.Show();
                    }
                    else
                    {
                        TwitterLoginButton.Show();
                    }
                }
                else
                {
                    throw e.Error;
                }
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddPointsText != null)
            {
                AddPointsText.Dispose();
                AddPointsText = null;
            }

            if (AreaCollection != null)
            {
                AreaCollection.Dispose();
                AreaCollection = null;
            }

            if (AreaCollectionHeight != null)
            {
                AreaCollectionHeight.Dispose();
                AreaCollectionHeight = null;
            }

            if (BkgdImage != null)
            {
                BkgdImage.Dispose();
                BkgdImage = null;
            }

            if (BtnPendingRequest != null)
            {
                BtnPendingRequest.Dispose();
                BtnPendingRequest = null;
            }

            if (CityLabel != null)
            {
                CityLabel.Dispose();
                CityLabel = null;
            }

            if (cnsAreaCollectionTop != null)
            {
                cnsAreaCollectionTop.Dispose();
                cnsAreaCollectionTop = null;
            }

            if (cnsMenuContainerHeight != null)
            {
                cnsMenuContainerHeight.Dispose();
                cnsMenuContainerHeight = null;
            }

            if (ConnectedNetworkText != null)
            {
                ConnectedNetworkText.Dispose();
                ConnectedNetworkText = null;
            }

            if (FacebookConnectedImage != null)
            {
                FacebookConnectedImage.Dispose();
                FacebookConnectedImage = null;
            }

            if (FacebookLabel != null)
            {
                FacebookLabel.Dispose();
                FacebookLabel = null;
            }

            if (FacebookLoginButton != null)
            {
                FacebookLoginButton.Dispose();
                FacebookLoginButton = null;
            }

            if (FriendsCountText != null)
            {
                FriendsCountText.Dispose();
                FriendsCountText = null;
            }

            if (InfoLabel != null)
            {
                InfoLabel.Dispose();
                InfoLabel = null;
            }

            if (InstagramConnectedImage != null)
            {
                InstagramConnectedImage.Dispose();
                InstagramConnectedImage = null;
            }

            if (InstagramLabel != null)
            {
                InstagramLabel.Dispose();
                InstagramLabel = null;
            }

            if (InstaLoginButton != null)
            {
                InstaLoginButton.Dispose();
                InstaLoginButton = null;
            }

            if (MainView != null)
            {
                MainView.Dispose();
                MainView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NetworksContainer != null)
            {
                NetworksContainer.Dispose();
                NetworksContainer = null;
            }

            if (PositionLabel != null)
            {
                PositionLabel.Dispose();
                PositionLabel = null;
            }

            if (ProfileImage != null)
            {
                ProfileImage.Dispose();
                ProfileImage = null;
            }

            if (Score != null)
            {
                Score.Dispose();
                Score = null;
            }

            if (ScoreImage != null)
            {
                ScoreImage.Dispose();
                ScoreImage = null;
            }

            if (scrlMainContent != null)
            {
                scrlMainContent.Dispose();
                scrlMainContent = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }

            if (TableViewHeight != null)
            {
                TableViewHeight.Dispose();
                TableViewHeight = null;
            }

            if (TwitterConnectedImage != null)
            {
                TwitterConnectedImage.Dispose();
                TwitterConnectedImage = null;
            }

            if (TwitterLabel != null)
            {
                TwitterLabel.Dispose();
                TwitterLabel = null;
            }

            if (TwitterLoginButton != null)
            {
                TwitterLoginButton.Dispose();
                TwitterLoginButton = null;
            }

            if (vMenuTableContainer != null)
            {
                vMenuTableContainer.Dispose();
                vMenuTableContainer = null;
            }

            if (vMenuTableInset != null)
            {
                vMenuTableInset.Dispose();
                vMenuTableInset = null;
            }

            if (vProfileInfoContainer != null)
            {
                vProfileInfoContainer.Dispose();
                vProfileInfoContainer = null;
            }
        }