ArcGISRuntime.WPF.Samples.AuthorMap.OAuthAuthorize.OnWindowClosed C# (CSharp) Метод

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

private OnWindowClosed ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        void OnWindowClosed(object sender, EventArgs e)
        {
            // If the browser window closes, return the focus to the main window
            if (_window != null && _window.Owner != null)
            {
                _window.Owner.Focus();
            }

            // If the task wasn't completed, the user must have closed the window without logging in
            if (_tcs != null && !_tcs.Task.IsCompleted)
            {
                // Set the task completion source exception to indicate a canceled operation
                _tcs.SetException(new OperationCanceledException());
            }

            // Set the task completion source and window to null to indicate the authorization process is complete
            _tcs = null;
            _window = null;
        }