diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-09 20:14:38 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-09 20:14:38 -0800 |
commit | 7bf63044b1a48dc6f1df95c63431e8130940595d (patch) | |
tree | f1827702b757452ef55971272962db73ada4985c /src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs | |
parent | 1473078585937057deca74a8264f332327ab9869 (diff) | |
download | DotNetOpenAuth-7bf63044b1a48dc6f1df95c63431e8130940595d.zip DotNetOpenAuth-7bf63044b1a48dc6f1df95c63431e8130940595d.tar.gz DotNetOpenAuth-7bf63044b1a48dc6f1df95c63431e8130940595d.tar.bz2 |
Fixed many FxCop messages in OAuth2 assemblies. #68
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs b/src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs index 1352786..a0204fa 100644 --- a/src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs +++ b/src/DotNetOpenAuth.OAuth2.Client.UI/OAuth2/ClientAuthorizationView.cs @@ -9,6 +9,7 @@ namespace DotNetOpenAuth.OAuth2 { using System.Collections.Generic; using System.ComponentModel; using System.Data; + using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Drawing; using System.Linq; @@ -106,6 +107,8 @@ namespace DotNetOpenAuth.OAuth2 { /// Raises the <see cref="E:System.Windows.Forms.UserControl.Load"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param> + [SuppressMessage("Microsoft.Usage", "CA2234:PassSystemUriObjectsInsteadOfStrings", Justification = "Avoid bug in .NET WebBrowser control.")] + [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "It's a new instance we control.")] protected override void OnLoad(EventArgs e) { base.OnLoad(e); @@ -144,7 +147,11 @@ namespace DotNetOpenAuth.OAuth2 { try { this.Client.ProcessUserAuthorization(location, this.Authorization); } catch (ProtocolException ex) { - MessageBox.Show(ex.ToStringDescriptive()); + var options = (MessageBoxOptions)0; + if (this.RightToLeft == System.Windows.Forms.RightToLeft.Yes) { + options |= MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign; + } + MessageBox.Show(this, ex.ToStringDescriptive(), ex.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, options); } finally { this.OnCompleted(); } @@ -168,25 +175,5 @@ namespace DotNetOpenAuth.OAuth2 { private void WebBrowser1_LocationChanged(object sender, EventArgs e) { this.ProcessLocationChanged(this.webBrowser1.Url); } - - /// <summary> - /// Describes the results of a completed authorization flow. - /// </summary> - public class ClientAuthorizationCompleteEventArgs : EventArgs { - /// <summary> - /// Initializes a new instance of the <see cref="ClientAuthorizationCompleteEventArgs"/> class. - /// </summary> - /// <param name="authorization">The authorization.</param> - public ClientAuthorizationCompleteEventArgs(IAuthorizationState authorization) { - Requires.NotNull(authorization, "authorization"); - this.Authorization = authorization; - } - - /// <summary> - /// Gets the authorization tracking object. - /// </summary> - /// <value>Null if authorization was rejected by the user.</value> - public IAuthorizationState Authorization { get; private set; } - } } } |