Skip to content

Commit 7c3ffb1

Browse files
Applied some recommended Resharper refactorings.
1 parent 824d5e7 commit 7c3ffb1

File tree

7 files changed

+5
-10
lines changed

7 files changed

+5
-10
lines changed

NScrape.Test/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following

NScrape/Forms/HtmlForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ private string DownloadFormHtml() {
315315
private void Initialize( int formOrdinal ) {
316316
var formDefinitions = HtmlFormDefinition.Parse( Html ).ToList();
317317

318-
if ( formOrdinal < 0 || formOrdinal >= formDefinitions.Count() ) {
318+
if ( formOrdinal < 0 || formOrdinal >= formDefinitions.Count ) {
319319
throw new ArgumentException( string.Format( CultureInfo.CurrentCulture, NScrapeResources.InvalidFormOrdinal, formOrdinal ) );
320320
}
321321

NScrape/GetWebRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public GetWebRequest( Uri destination, bool autoRedirect )
4040
/// </returns>
4141
public override string ToString()
4242
{
43-
return string.Format("GET {0}", this.Destination);
43+
return string.Format("GET {0}", Destination);
4444
}
4545
}
4646
}

NScrape/NScrapeUtility.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
using System;
2-
using System.Collections.Specialized;
32
using System.Globalization;
4-
using System.Web;
5-
using Microsoft.JScript;
63

74
namespace NScrape {
85
/// <summary>

NScrape/PostWebRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public PostWebRequest( Uri destination, string requestData, string contentType,
120120
/// </returns>
121121
public override string ToString()
122122
{
123-
return string.Format("POST {0}", this.Destination);
123+
return string.Format("POST {0}", Destination);
124124
}
125125
}
126126
}

NScrape/RedirectedWebResponse.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.IO;
32

43
namespace NScrape {
54
/// <summary>

NScrape/UnexpectedWebResponseGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static Exception CreateException( string message, WebResponse response )
1212
switch ( response.ResponseType ) {
1313

1414
case WebResponseType.Exception:
15-
var exceptionResponse = response as ExceptionWebResponse;
15+
var exceptionResponse = (ExceptionWebResponse)response;
1616

1717
exception = exceptionResponse.Exception;
1818
break;
@@ -26,7 +26,7 @@ public static Exception CreateException( string message, WebResponse response )
2626
break;
2727

2828
case WebResponseType.Unsupported:
29-
var unsupportedResponse = response as UnsupportedWebResponse;
29+
var unsupportedResponse = (UnsupportedWebResponse)response;
3030

3131
exception = new WebException( string.Format( CultureInfo.CurrentCulture, NScrapeResources.UnsupportedResponseContentType, unsupportedResponse.ContentType ) );
3232
break;

0 commit comments

Comments
 (0)