private void ShowOAuthPropsUi()
        {
            if (_oauthInfoUi != null)
            {
                return;
            }

            // Create a view to show entry controls over the map view.
            nfloat topMargin = NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height;
            var    ovBounds  = new CGRect(5, topMargin + 5, View.Bounds.Width - 10, View.Bounds.Height - topMargin - 50);

            _oauthInfoUi = new OAuthPropsDialogOverlay(ovBounds, 0.75f, UIColor.White, _appClientId, _oAuthRedirectUrl);

            // Handle the OnOAuthPropsInfoEntered event to get the info entered by the user.
            _oauthInfoUi.OnOAuthPropsInfoEntered += (s, e) =>
            {
                // Store the settings entered and use them to update the AuthenticationManager.
                _appClientId      = e.ClientId;
                _oAuthRedirectUrl = e.RedirectUrl;
                UpdateAuthenticationManager();

                // Hide the OAuth entry.
                _oauthInfoUi.Hide();
                _oauthInfoUi = null;
            };

            // Handle the cancel event when the user closes the dialog without choosing to save.
            _oauthInfoUi.OnCanceled += (s, e) =>
            {
                _oauthInfoUi.Hide();
                _oauthInfoUi = null;
            };

            // Add the map item info UI view (will display semi-transparent over the map view).
            View.Add(_oauthInfoUi);
        }
Пример #2
0
        private void ShowOAuthPropsUI()
        {
            if (_oauthInfoUI != null)
            {
                return;
            }

            // Create a view to show entry controls over the map view

            var ovBounds = new CoreGraphics.CGRect(30, 60, (View.Bounds.Width - 60), (View.Bounds.Height - 120));

            _oauthInfoUI = new OAuthPropsDialogOverlay(ovBounds, 0.75f, UIColor.White, AppClientId, OAuthRedirectUrl);

            // Handle the OnOAuthPropsInfoEntered event to get the info entered by the user
            _oauthInfoUI.OnOAuthPropsInfoEntered += (s, e) =>
            {
                // Store the settings entered and use them to update the AuthenticationManager
                AppClientId      = e.ClientId;
                OAuthRedirectUrl = e.RedirectUrl;
                UpdateAuthenticationManager();

                // Hide the OAuth entry
                _oauthInfoUI.Hide();
                _oauthInfoUI = null;
            };

            // Handle the cancel event when the user closes the dialog without choosing to save
            _oauthInfoUI.OnCanceled += (s, e) =>
            {
                _oauthInfoUI.Hide();
                _oauthInfoUI = null;
            };

            // Add the map item info UI view (will display semi-transparent over the map view)
            View.Add(_oauthInfoUI);
        }