Esempio n. 1
0
        private void ShowOAuthPropsUI()
        {
            if (_oauthInfoUI != null)
            {
                return;
            }

            // Create a view to show entry controls over the map view
            var ovBounds = new CoreGraphics.CGRect(0, yPageOffset, View.Bounds.Width, View.Bounds.Height);

            _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);
        }
        private void ShowOAuthPropsUi()
        {
            if (_oauthInfoUi != null)
            {
                return;
            }

            nfloat topMargin = NavigationController.NavigationBar.Frame.Height + UIApplication.SharedApplication.StatusBarFrame.Height;

            // Create a view to show entry controls over the map view.
            var ovBounds = new CGRect(0, topMargin, View.Bounds.Width, View.Bounds.Height);

            _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);
        }