Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit b9ae2ab

Browse files
committed
Lots of StyleCop fixes.
1 parent 3d37ff4 commit b9ae2ab

File tree

62 files changed

+314
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+314
-260
lines changed

samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static Consumer CreateConsumer(bool forWeb = true) {
154154
}
155155

156156
public async Task<JArray> GetUpdatesAsync(AccessToken accessToken, CancellationToken cancellationToken = default(CancellationToken)) {
157-
if (String.IsNullOrEmpty(accessToken.Token)) {
157+
if (string.IsNullOrEmpty(accessToken.Token)) {
158158
throw new ArgumentNullException("accessToken.Token");
159159
}
160160

@@ -169,7 +169,7 @@ public static Consumer CreateConsumer(bool forWeb = true) {
169169
}
170170

171171
public async Task<XDocument> GetFavorites(AccessToken accessToken, CancellationToken cancellationToken = default(CancellationToken)) {
172-
if (String.IsNullOrEmpty(accessToken.Token)) {
172+
if (string.IsNullOrEmpty(accessToken.Token)) {
173173
throw new ArgumentNullException("accessToken.Token");
174174
}
175175

samples/OAuthClient/WindowsLive.aspx.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ protected void Page_Load(object sender, EventArgs e) {
3333
await client.ProcessUserAuthorizationAsync(new HttpRequestWrapper(Request), Response.ClientDisconnectedToken);
3434
if (authorization == null) {
3535
// Kick off authorization request
36-
var request =
37-
await client.PrepareRequestUserAuthorizationAsync(scopes: new[] { WindowsLiveClient.Scopes.Basic });
38-
// this scope isn't even required just to log in
36+
var request = await client.PrepareRequestUserAuthorizationAsync(scopes: new[] { WindowsLiveClient.Scopes.Basic }); // this scope isn't even required just to log in
3937
await request.SendAsync(new HttpContextWrapper(this.Context), Response.ClientDisconnectedToken);
4038
this.Context.Response.End();
4139
} else {

samples/OAuthConsumerWpf/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private async void oauth2BeginButton_Click(object sender, RoutedEventArgs e) {
176176
authorizePopup.Authorization.Scope.AddRange(OAuthUtilities.SplitScopes(this.oauth2ScopeBox.Text));
177177
authorizePopup.Authorization.Callback = new Uri("http://www.microsoft.com/en-us/default.aspx");
178178
authorizePopup.Owner = this;
179-
authorizePopup.ClientAuthorizationView.RequestImplicitGrant = flowBox.SelectedIndex == 1;
179+
authorizePopup.ClientAuthorizationView.RequestImplicitGrant = this.flowBox.SelectedIndex == 1;
180180
bool? result = authorizePopup.ShowDialog();
181181
if (result.HasValue && result.Value) {
182182
var request = new HttpRequestMessage(

samples/OAuthServiceProvider/Code/Global.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
/// The web application global events and properties.
1111
/// </summary>
1212
public class Global : HttpApplication {
13-
private readonly object syncObject = new object();
14-
15-
private volatile bool initialized;
16-
1713
/// <summary>
1814
/// An application memory cache of recent log messages.
1915
/// </summary>
@@ -24,6 +20,10 @@ public class Global : HttpApplication {
2420
/// </summary>
2521
public static log4net.ILog Logger = log4net.LogManager.GetLogger("DotNetOpenAuth.OAuthServiceProvider");
2622

23+
private readonly object syncObject = new object();
24+
25+
private volatile bool initialized;
26+
2727
/// <summary>
2828
/// Gets the transaction-protected database connection for the current request.
2929
/// </summary>

samples/OpenIdOfflineProvider/MainWindow.xaml.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
2020
using System.Threading;
2121
using System.Threading.Tasks;
2222
using System.Web;
23+
using System.Web.Http;
2324
using System.Web.Http.Routing;
2425
using System.Web.Http.SelfHost;
2526
using System.Windows;
@@ -39,12 +40,15 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
3940
using log4net.Core;
4041
using Validation;
4142

42-
using System.Web.Http;
43-
4443
/// <summary>
4544
/// Interaction logic for MainWindow.xaml
4645
/// </summary>
4746
public partial class MainWindow : Window, IDisposable {
47+
/// <summary>
48+
/// The main window for the app.
49+
/// </summary>
50+
internal static MainWindow Instance;
51+
4852
/// <summary>
4953
/// The logger the application may use.
5054
/// </summary>
@@ -69,8 +73,6 @@ public MainWindow() {
6973
this.StartProviderAsync();
7074
}
7175

72-
internal static MainWindow Instance;
73-
7476
#region IDisposable Members
7577

7678
/// <summary>
@@ -155,6 +157,7 @@ private void ClearLogButton_Click(object sender, RoutedEventArgs e) {
155157
/// <summary>
156158
/// Starts the provider.
157159
/// </summary>
160+
/// <returns>A task that completes when the asynchronous operation is finished.</returns>
158161
private async Task StartProviderAsync() {
159162
Exception exception = null;
160163
try {
@@ -199,6 +202,7 @@ private async Task StartProviderAsync() {
199202
/// <summary>
200203
/// Stops the provider.
201204
/// </summary>
205+
/// <returns>A task that completes when the asynchronous operation is finished.</returns>
202206
private async Task StopProviderAsync() {
203207
if (this.hostServer != null) {
204208
await this.hostServer.CloseAsync();

samples/OpenIdOfflineProvider/Settings.StyleCop

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<StyleCopSettings Version="4.3">
1+
<StyleCopSettings Version="105">
22
<Analyzers>
33
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
44
<Rules>
@@ -7,11 +7,6 @@
77
<BooleanProperty Name="Enabled">True</BooleanProperty>
88
</RuleSettings>
99
</Rule>
10-
<Rule Name="ElementsMustBeDocumented">
11-
<RuleSettings>
12-
<BooleanProperty Name="Enabled">True</BooleanProperty>
13-
</RuleSettings>
14-
</Rule>
1510
</Rules>
1611
<AnalyzerSettings />
1712
</Analyzer>

samples/OpenIdWebRingSsoRelyingParty/Login.aspx.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ protected void Page_Load(object sender, EventArgs e) {
8080
response.ClaimedIdentifier,
8181
DateTime.Now,
8282
DateTime.Now.AddMinutes(TimeoutInMinutes),
83-
false,
84-
// non-persistent, since login is automatic and we wanted updated roles
83+
false, // non-persistent, since login is automatic and we wanted updated roles
8584
string.Join(";", roles.ToArray()));
8685

8786
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(ticket));

src/DotNetOpenAuth.AspNet.Test/OAuth2ClientTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace DotNetOpenAuth.AspNet.Test {
88
using System;
99
using System.Collections.Generic;
1010
using System.Collections.Specialized;
11+
using System.Threading.Tasks;
1112
using System.Web;
1213
using DotNetOpenAuth.AspNet.Clients;
1314
using Moq;
1415
using NUnit.Framework;
15-
using System.Threading.Tasks;
1616

1717
[TestFixture]
1818
public class OAuth2ClientTest {

src/DotNetOpenAuth.AspNet.Test/OAuthClientTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
namespace DotNetOpenAuth.AspNet.Test {
88
using System;
99
using System.Collections.Specialized;
10+
using System.Threading;
11+
using System.Threading.Tasks;
1012
using System.Web;
1113
using DotNetOpenAuth.AspNet;
1214
using DotNetOpenAuth.AspNet.Clients;
1315
using DotNetOpenAuth.Messaging;
16+
using DotNetOpenAuth.OAuth;
1417
using DotNetOpenAuth.OAuth.Messages;
1518
using Moq;
1619
using NUnit.Framework;
17-
using DotNetOpenAuth.OAuth;
18-
using System.Threading;
19-
using System.Threading.Tasks;
2020

2121
[TestFixture]
2222
public class OAuthClientTest {

src/DotNetOpenAuth.AspNet/AuthenticationResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
namespace DotNetOpenAuth.AspNet {
88
using System;
99
using System.Collections.Generic;
10+
using System.Collections.Specialized;
1011
using System.Diagnostics.CodeAnalysis;
1112
using DotNetOpenAuth.Messaging;
12-
using System.Collections.Specialized;
1313

1414
/// <summary>
1515
/// Represents the result of OAuth or OpenID authentication.

0 commit comments

Comments
 (0)