summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Core/Configuration/TypeConfigurationElement.cs8
-rw-r--r--src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj1
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/Bindings/CryptoKeyCollisionException.cs4
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/HmacAlgorithms.cs2
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs6
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs28
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/ProtocolException.cs4
-rw-r--r--src/DotNetOpenAuth.Core/PureAttribute.cs22
-rw-r--r--src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs4
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/BearerTokenHttpMessageHandler.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs4
-rw-r--r--src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs6
12 files changed, 0 insertions, 91 deletions
diff --git a/src/DotNetOpenAuth.Core/Configuration/TypeConfigurationElement.cs b/src/DotNetOpenAuth.Core/Configuration/TypeConfigurationElement.cs
index a3a8140..d554832 100644
--- a/src/DotNetOpenAuth.Core/Configuration/TypeConfigurationElement.cs
+++ b/src/DotNetOpenAuth.Core/Configuration/TypeConfigurationElement.cs
@@ -11,11 +11,7 @@ namespace DotNetOpenAuth.Configuration {
using System.IO;
using System.Reflection;
using System.Web;
-#if CLR4
using System.Xaml;
-#else
- using System.Windows.Markup;
-#endif
using DotNetOpenAuth.Messaging;
/// <summary>
@@ -127,11 +123,7 @@ namespace DotNetOpenAuth.Configuration {
/// be present.
/// </remarks>
private static T CreateInstanceFromXaml(Stream xaml) {
-#if CLR4
return (T)XamlServices.Load(xaml);
-#else
- return (T)XamlReader.Load(xaml);
-#endif
}
}
}
diff --git a/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj b/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
index 50b8a67..cfe6ffd 100644
--- a/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
+++ b/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
@@ -134,7 +134,6 @@
<Compile Include="Loggers\TraceLogger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Messaging\ReadOnlyDictionary.cs" />
- <Compile Include="PureAttribute.cs" />
<Compile Include="Reporting.cs" />
<Compile Include="RequiresEx.cs" />
<Compile Include="Strings.Designer.cs">
diff --git a/src/DotNetOpenAuth.Core/Messaging/Bindings/CryptoKeyCollisionException.cs b/src/DotNetOpenAuth.Core/Messaging/Bindings/CryptoKeyCollisionException.cs
index 1fe4493..7507b31 100644
--- a/src/DotNetOpenAuth.Core/Messaging/Bindings/CryptoKeyCollisionException.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/Bindings/CryptoKeyCollisionException.cs
@@ -56,11 +56,7 @@ namespace DotNetOpenAuth.Messaging.Bindings {
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*"/>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter"/>
/// </PermissionSet>
-#if CLR4
[System.Security.SecurityCritical]
-#else
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
-#endif
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) {
base.GetObjectData(info, context);
throw new NotImplementedException();
diff --git a/src/DotNetOpenAuth.Core/Messaging/HmacAlgorithms.cs b/src/DotNetOpenAuth.Core/Messaging/HmacAlgorithms.cs
index c80ebfe..be7e96b 100644
--- a/src/DotNetOpenAuth.Core/Messaging/HmacAlgorithms.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/HmacAlgorithms.cs
@@ -51,9 +51,7 @@ namespace DotNetOpenAuth.Messaging {
hmac.Key = key;
return hmac;
} catch {
-#if CLR4
hmac.Dispose();
-#endif
throw;
}
}
diff --git a/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs b/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
index 55233c2..f3a1ba8 100644
--- a/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/HttpRequestInfo.cs
@@ -12,10 +12,8 @@ namespace DotNetOpenAuth.Messaging {
using System.Globalization;
using System.IO;
using System.Net;
-#if CLR4
using System.Net.Http;
using System.Net.Http.Headers;
-#endif
using System.Net.Mime;
using System.ServiceModel.Channels;
using System.Web;
@@ -124,7 +122,6 @@ namespace DotNetOpenAuth.Messaging {
Reporting.RecordRequestStatistics(this);
}
-#if CLR4
/// <summary>
/// Initializes a new instance of the <see cref="HttpRequestInfo" /> class.
/// </summary>
@@ -144,7 +141,6 @@ namespace DotNetOpenAuth.Messaging {
Reporting.RecordRequestStatistics(this);
}
-#endif
/// <summary>
/// Initializes a new instance of the <see cref="HttpRequestInfo"/> class.
@@ -309,7 +305,6 @@ namespace DotNetOpenAuth.Messaging {
return new NameValueCollection();
}
-#if CLR4
/// <summary>
/// Adds HTTP headers to a <see cref="NameValueCollection"/>.
/// </summary>
@@ -325,6 +320,5 @@ namespace DotNetOpenAuth.Messaging {
}
}
}
-#endif
}
}
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
index fffb855..221a29c 100644
--- a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
@@ -14,9 +14,7 @@ namespace DotNetOpenAuth.Messaging {
using System.IO.Compression;
using System.Linq;
using System.Net;
-#if CLR4
using System.Net.Http;
-#endif
using System.Net.Mime;
using System.Runtime.Serialization.Json;
using System.Security;
@@ -167,7 +165,6 @@ namespace DotNetOpenAuth.Messaging {
return new OutgoingWebResponseActionResult(response);
}
-#if CLR4
/// <summary>
/// Transforms an OutgoingWebResponse to a Web API-friendly HttpResponseMessage.
/// </summary>
@@ -188,7 +185,6 @@ namespace DotNetOpenAuth.Messaging {
return response;
}
-#endif
/// <summary>
/// Gets the original request URL, as seen from the browser before any URL rewrites on the server if any.
@@ -456,11 +452,7 @@ namespace DotNetOpenAuth.Messaging {
return new XmlReaderSettings {
MaxCharactersFromEntities = 1024,
XmlResolver = null,
-#if CLR4
DtdProcessing = DtdProcessing.Prohibit,
-#else
- ProhibitDtd = true,
-#endif
};
}
@@ -1136,26 +1128,6 @@ namespace DotNetOpenAuth.Messaging {
}
}
-#if !CLR4
- /// <summary>
- /// Copies the contents of one stream to another.
- /// </summary>
- /// <param name="copyFrom">The stream to copy from, at the position where copying should begin.</param>
- /// <param name="copyTo">The stream to copy to, at the position where bytes should be written.</param>
- /// <returns>The total number of bytes copied.</returns>
- /// <remarks>
- /// Copying begins at the streams' current positions.
- /// The positions are NOT reset after copying is complete.
- /// </remarks>
- internal static int CopyTo(this Stream copyFrom, Stream copyTo) {
- Requires.NotNull(copyFrom, "copyFrom");
- Requires.NotNull(copyTo, "copyTo");
- Requires.That(copyFrom.CanRead, "copyFrom", MessagingStrings.StreamUnreadable);
- Requires.That(copyTo.CanWrite, "copyTo", MessagingStrings.StreamUnwritable);
- return CopyUpTo(copyFrom, copyTo, int.MaxValue);
- }
-#endif
-
/// <summary>
/// Copies the contents of one stream to another.
/// </summary>
diff --git a/src/DotNetOpenAuth.Core/Messaging/ProtocolException.cs b/src/DotNetOpenAuth.Core/Messaging/ProtocolException.cs
index 4bc3590..a45e397 100644
--- a/src/DotNetOpenAuth.Core/Messaging/ProtocolException.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/ProtocolException.cs
@@ -80,11 +80,7 @@ namespace DotNetOpenAuth.Messaging {
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*"/>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter"/>
/// </PermissionSet>
-#if CLR4
[SecurityCritical]
-#else
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
-#endif
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) {
base.GetObjectData(info, context);
throw new NotImplementedException();
diff --git a/src/DotNetOpenAuth.Core/PureAttribute.cs b/src/DotNetOpenAuth.Core/PureAttribute.cs
deleted file mode 100644
index 04f7ead..0000000
--- a/src/DotNetOpenAuth.Core/PureAttribute.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="PureAttribute.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace System.Diagnostics.Contracts {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
-#if !CLR4
- /// <summary>
- /// Designates a type or member as one that does not mutate any objects that were allocated
- /// before the invocation of the member.
- /// </summary>
- [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)]
- internal sealed class PureAttribute : Attribute {
- }
-#endif
-}
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
index 5b47d0a..a5f7d9b 100644
--- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
+++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
@@ -9,9 +9,7 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
-#if CLR4
using System.Net.Http;
-#endif
using System.Security.Cryptography;
using System.Text;
using System.Web;
@@ -132,7 +130,6 @@ namespace DotNetOpenAuth.OAuth2 {
this.Channel.Respond(response);
}
-#if CLR4
/// <summary>
/// Handles an incoming request to the authorization server's token endpoint.
/// </summary>
@@ -141,7 +138,6 @@ namespace DotNetOpenAuth.OAuth2 {
public OutgoingWebResponse HandleTokenRequest(HttpRequestMessage request) {
return this.HandleTokenRequest(new HttpRequestInfo(request));
}
-#endif
/// <summary>
/// Handles an incoming request to the authorization server's token endpoint.
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/BearerTokenHttpMessageHandler.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/BearerTokenHttpMessageHandler.cs
index 8c802ff..da4c869 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/BearerTokenHttpMessageHandler.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/BearerTokenHttpMessageHandler.cs
@@ -4,7 +4,6 @@
// </copyright>
//-----------------------------------------------------------------------
-#if CLR4
namespace DotNetOpenAuth.OAuth2 {
using System;
using System.Collections.Generic;
@@ -91,4 +90,3 @@ namespace DotNetOpenAuth.OAuth2 {
}
}
}
-#endif \ No newline at end of file
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
index b2178e9..d66f4fd 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
@@ -10,9 +10,7 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Globalization;
using System.Linq;
using System.Net;
-#if CLR4
using System.Net.Http;
-#endif
using System.Security;
using System.Text;
using System.Xml;
@@ -145,7 +143,6 @@ namespace DotNetOpenAuth.OAuth2 {
AuthorizeRequest(requestHeaders, authorization.AccessToken);
}
-#if CLR4
/// <summary>
/// Creates an HTTP handler that automatically applies an OAuth 2 (bearer) access token to outbound HTTP requests.
/// The result of this method can be supplied to the <see cref="HttpClient(HttpMessageHandler)"/> constructor.
@@ -169,7 +166,6 @@ namespace DotNetOpenAuth.OAuth2 {
Requires.NotNull(authorization, "authorization");
return new BearerTokenHttpMessageHandler(this, authorization, innerHandler ?? new HttpClientHandler());
}
-#endif
/// <summary>
/// Refreshes a short-lived access token using a longer-lived refresh token
diff --git a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
index 540773f..bd129c0 100644
--- a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
+++ b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
@@ -10,9 +10,7 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net;
-#if CLR4
using System.Net.Http;
-#endif
using System.Security.Principal;
using System.ServiceModel.Channels;
using System.Text;
@@ -129,7 +127,6 @@ namespace DotNetOpenAuth.OAuth2 {
}
}
-#if CLR4
/// <summary>
/// Discovers what access the client should have considering the access token in the current request.
/// </summary>
@@ -146,7 +143,6 @@ namespace DotNetOpenAuth.OAuth2 {
Requires.NotNull(request, "request");
return this.GetAccessToken(new HttpRequestInfo(request), requiredScopes);
}
-#endif
/// <summary>
/// Discovers what access the client should have considering the access token in the current request.
@@ -197,7 +193,6 @@ namespace DotNetOpenAuth.OAuth2 {
return this.GetPrincipal(new HttpRequestInfo(request, requestUri), requiredScopes);
}
-#if CLR4
/// <summary>
/// Discovers what access the client should have considering the access token in the current request.
/// </summary>
@@ -214,6 +209,5 @@ namespace DotNetOpenAuth.OAuth2 {
Requires.NotNull(request, "request");
return this.GetPrincipal(new HttpRequestInfo(request), requiredScopes);
}
-#endif
}
}