ArcGISWindowsPhoneSDK.OwnershipBasedEditing.Challenge C# (CSharp) Метод

Challenge() приватный Метод

private Challenge ( string url, Exception>.Action callback, IdentityManager options ) : void
url string
callback Exception>.Action
options IdentityManager
Результат void
        private void Challenge(string url,
            Action<IdentityManager.Credential, Exception> callback, IdentityManager.GenerateTokenOptions options)
        {
            LoginGrid.Visibility = System.Windows.Visibility.Visible;

            TitleTextBlock.Text = string.Format("Login to access: \n{0}", url);

            if (!challengeAttemptsPerUrl.ContainsKey(url))
                challengeAttemptsPerUrl.Add(url, 0);

            RoutedEventHandler handleClick = null;
            handleClick = (s, e) =>
            {
                IdentityManager.Current.GenerateCredentialAsync(url, UserTextBox.Text, PasswordTextBox.Text,
                (credential, ex) =>
                {
                    challengeAttemptsPerUrl[url]++;
                    if (ex == null || challengeAttemptsPerUrl[url] == 3)
                    {
                        LoginLoadLayerButton.Click -= handleClick;
                        callback(credential, ex);
                        LoggedInUserButton.Content = credential.UserName;
                    }

                }, options);
            };
            LoginLoadLayerButton.Click += handleClick;

            System.Windows.Input.KeyEventHandler handleEnterKeyDown = null;
            handleEnterKeyDown = (s, e) =>
            {
                if (e.Key == System.Windows.Input.Key.Enter)
                {
                    PasswordTextBox.KeyDown -= handleEnterKeyDown;
                    handleClick(null, null);
                }
            };
            PasswordTextBox.KeyDown += handleEnterKeyDown;
        }