+2010-03-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * moonlight_*_System.dll.sources: Bring extra types so we can
+ build a full, managed, internal HTTP stack to be reused for SL3+
+ * Makefile: Add a INSIDE_SYSTEM define when compiling System.dll
+ to makes it possible to rebuild the same types in System.Net.dll
+
2010-03-16 Jb Evain <jbevain@novell.com>
* net_2_1_*.dll.sources: rename to moonlight_*.dll.sources.
PROFILE_2_OR_4 := $(filter net_2_0 net_4_0, $(PROFILE))
NOT_SL := $(filter net_2_0 net_4_0 monotouch, $(PROFILE))
endif
+ifeq (2.1, $(FRAMEWORK_VERSION))
+LIB_MCS_FLAGS += -d:INSIDE_SYSTEM
+endif
EXTRA_DISTFILES = \
System.Text.RegularExpressions/notes.txt \
+2010-03-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Socket.cs: Remove some NET_2_0 defines (using) and add a few
+ MOONLIGHT defines needed to reuse Socket in the client http stack
+ * Socket_2_1.cs: Remove some MOONLIGHT defines
+ * SocketAsyncEventArgs.cs: For Moonlight check policy if outside
+ System.dll (the client stack use sockets with it's own web
+ xdomain policy)
+
2010-03-16 Jb Evain <jbevain@novell.com>
* Socket_2_1.cs, SocketAsyncEventArgs.cs: use MOONLIGHT symbol to
using System;
using System.Net;
using System.Collections;
+using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.IO;
using System.Net.Configuration;
using System.Text;
-
-#if NET_2_0
-using System.Collections.Generic;
-using System.Net.NetworkInformation;
using System.Timers;
+#if !MOONLIGHT
+using System.Net.NetworkInformation;
#endif
namespace System.Net.Sockets
seed_endpoint = local_end;
}
-#if NET_2_0
+#if !MOONLIGHT
public bool ConnectAsync (SocketAsyncEventArgs e)
{
// NO check is made whether e != null in MS.NET (NRE is thrown in such case)
using System.Reflection;
using System.Security;
using System.Threading;
-#if MOONLIGHT
+#if MOONLIGHT && !INSIDE_SYSTEM
using System.Net.Policy;
#endif
{
curSocket.Connected = false;
SocketError error = SocketError.Success;
-#if MOONLIGHT
+#if MOONLIGHT && !INSIDE_SYSTEM
// if we're not downloading a socket policy then check the policy
if (!PolicyRestricted) {
error = SocketError.AccessDenied;
bool block,
out int error);
#endif
-#if !MOONLIGHT
+
public bool Blocking {
get {
return(blocking);
blocking=value;
}
}
-#endif
+
public bool Connected {
get { return connected; }
internal set { connected = value; }
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static bool Poll_internal (IntPtr socket, SelectMode mode, int timeout, out int error);
-#if !MOONLIGHT
/* This overload is needed as the async Connect method
* also needs to check the socket error status, but
* getsockopt(..., SO_ERROR) clears the error.
return result;
}
-#endif
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static int Receive_internal(IntPtr sock,
byte[] buffer,
//
using System.Collections;
+using System.Collections.Specialized;
using System.Configuration;
-#if NET_2_0
using System.Net.Configuration;
-using System.Collections.Specialized;
-#endif
namespace System.Net
{
- public class AuthenticationManager
- {
+#if MOONLIGHT
+ internal class AuthenticationManager {
+#else
+ public class AuthenticationManager {
+#endif
static ArrayList modules;
static object locker = new object ();
return;
modules = new ArrayList ();
-#if MONOTOUCH
+#if NET_2_1
modules.Add (new BasicClient ());
modules.Add (new DigestClient ());
modules.Add (new NtlmClient ());
-#else
-#if NET_2_0 && CONFIGURATION_DEP
+#elif NET_2_0 && CONFIGURATION_DEP
object cfg = ConfigurationManager.GetSection ("system.net/authenticationModules");
AuthenticationModulesSection s = cfg as AuthenticationModulesSection;
if (s != null) {
}
#else
ConfigurationSettings.GetConfig ("system.net/authenticationModules");
-#endif
#endif
}
}
-#if NET_2_0
static ICredentialPolicy credential_policy = null;
public static ICredentialPolicy CredentialPolicy
throw GetMustImplement ();
}
}
-#endif
public static IEnumerator RegisteredModules {
get {
+2010-03-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AuthenticationManager.cs: Internal type for Moonlight.
+ Add BasicClient, DigestClient, NtlmClient for NET_2_1 since
+ this applies to both monotouch and moonlight (client stack).
+ Removed unneeded NET_2_0 defines
+ * CookieContainer.cs: For Moonlight it needs to be internal in
+ System.dll and public in System.Net.dll. Removed unneeded NET_2_0
+ defines
+ * HttpContinueDelegate.cs: Internal type for Moonlight.
+ * HttpRequestCreator.cs: Remove a MOONLIGHT define
+ * HttpStatusCode.cs: For Moonlight it needs to be internal in
+ System.dll and public in System.Net.dll
+ * HttpWebRequest.cs: Internal type for Moonlight. Change S.Config
+ to NET_2_1 defines (applies to both monotouch and moonlight).
+ Removed unneeded NET_2_0 and NET_1_1 defines
+ * HttpWebResponse.cs: Internal type for Moonlight. Removed
+ unneeded NET_2_0 defines
+ * IAuthenticationModule.cs: Internal type for Moonlight.
+ * ICertificatePolicy.cs: Internal type for Moonlight.
+ * ICredentialPolicy.cs: Internal type for Moonlight. Removed
+ unneeded NET_2_0 defines
+ * IWebRequestCreate.cs: For Moonlight it needs to be internal in
+ System.dll and public in System.Net.dll
+ * ServicePoint.cs: Internal type for Moonlight. Change S.Config
+ to NET_2_1 defines (applies to both monotouch and moonlight)
+ * ServicePointManager.cs: Remove a MOONLIGHT define
+ * WebException.cs: For Moonlight it needs to be internal in
+ System.dll and public in System.Net.dll. Removed unneeded NET_2_0
+ defines
+ * WebHeaderCollection.cs: Internal type for Moonlight. Removed
+ unneeded NET_2_0 defines
+ * WebRequest.cs: Internal type for Moonlight. Change S.Config
+ to NET_2_1 defines (applies to both monotouch and moonlight)
+ * WebResponse.cs: Internal type for Moonlight. Removed unneeded
+ NET_2_0 defines
+
2010-03-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
* FtpWebResponse.cs:
namespace System.Net
{
[Serializable]
-#if NET_2_1
+#if MOONLIGHT
+ #if INSIDE_SYSTEM
+ internal sealed class CookieContainer {
+ #else
public sealed class CookieContainer {
+ #endif
#else
public class CookieContainer {
#endif
public CookieContainer (int capacity)
{
if (capacity <= 0)
-#if NET_2_0
throw new ArgumentException ("Must be greater than zero", "Capacity");
-#else
- throw new ArgumentException ("Capacity");
-#endif
this.capacity = capacity;
}
: this (capacity)
{
if (perDomainCapacity != Int32.MaxValue && (perDomainCapacity <= 0 || perDomainCapacity > capacity))
-#if NET_2_0
throw new ArgumentOutOfRangeException ("perDomainCapacity",
string.Format ("PerDomainCapacity must be " +
"greater than {0} and less than {1}.", 0,
capacity));
-#else
- throw new ArgumentException ("PerDomainCapacity");
-#endif
if (maxCookieSize <= 0)
-#if NET_2_0
throw new ArgumentException ("Must be greater than zero", "MaxCookieSize");
-#else
- throw new ArgumentException ("MaxCookieSize");
-#endif
this.perDomainCapacity = perDomainCapacity;
this.maxCookieSize = maxCookieSize;
throw new ArgumentNullException ("cookie");
if (cookie.Domain.Length == 0)
-#if NET_2_0
throw new ArgumentException ("Cookie domain not set.", "cookie.Domain");
-#else
- throw new ArgumentException ("cookie.Domain");
-#endif
if (cookie.Value.Length > maxCookieSize)
throw new CookieException ("value is larger than MaxCookieSize.");
\r
namespace System.Net\r
{\r
- public delegate void HttpContinueDelegate (\r
+#if MOONLIGHT\r
+ internal\r
+#else\r
+ public\r
+#endif\r
+ delegate void HttpContinueDelegate (\r
int StatusCode,\r
WebHeaderCollection httpHeaders);\r
}\r
public WebRequest Create (Uri uri)
{
-#if MOONLIGHT
- throw new NotImplementedException ();
-#else
return new HttpWebRequest (uri);
-#endif
}
}
}
namespace System.Net {
+#if MOONLIGHT && INSIDE_SYSTEM
+ internal enum HttpStatusCode {
+#else
public enum HttpStatusCode {
+#endif
Continue = 100,
SwitchingProtocols = 101,
OK = 200,
using System.Collections;
using System.Configuration;
using System.IO;
+using System.Net.Cache;
using System.Net.Sockets;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization;
using System.Text;
using System.Threading;
-#if NET_2_0
-using System.Net.Cache;
-#endif
-
namespace System.Net
{
+#if MOONLIGHT
+ internal class HttpWebRequest : WebRequest, ISerializable {
+#else
[Serializable]
- public class HttpWebRequest : WebRequest, ISerializable
- {
+ public class HttpWebRequest : WebRequest, ISerializable {
+#endif
Uri requestUri;
Uri actualUri;
bool hostChanged;
bool is_ntlm_auth;
bool finished_reading;
internal WebConnection WebConnection;
-#if NET_2_0
DecompressionMethods auto_decomp;
-#endif
-#if NET_1_1
int maxResponseHeadersLength;
static int defaultMaxResponseHeadersLength;
int readWriteTimeout = 300000; // ms
static HttpWebRequest ()
{
defaultMaxResponseHeadersLength = 64 * 1024;
-#if !MONOTOUCH
+#if !NET_2_1
NetConfig config = ConfigurationSettings.GetConfig ("system.net/settings") as NetConfig;
if (config != null) {
int x = config.MaxResponseHeadersLength;
}
#endif
}
-#endif
#if NET_2_1
public
this.proxy = GlobalProxySelection.Select;
}
-#if NET_2_0
[Obsolete ("Serialization is obsoleted for this type", false)]
-#endif
protected HttpWebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
SerializationInfo info = serializationInfo;
set { allowBuffering = value; }
}
-#if NET_2_0
static Exception GetMustImplement ()
{
return new NotImplementedException ();
auto_decomp = value;
}
}
-#endif
internal bool InternalAllowBuffering {
get {
return certificates;
}
-#if NET_2_0
[MonoTODO]
set {
throw GetMustImplement ();
}
-#endif
}
public string Connection {
set { credentials = value; }
}
-#if NET_2_0
[MonoTODO]
public static new RequestCachePolicy DefaultCachePolicy
{
throw GetMustImplement ();
}
}
-#endif
public string Expect {
get { return webHeaders ["Expect"]; }
}
}
-#if NET_1_1
[MonoTODO ("Use this")]
public int MaximumResponseHeadersLength {
get { return maxResponseHeadersLength; }
set { defaultMaxResponseHeadersLength = value; }
}
- public
-#else
- internal
-#endif
- int ReadWriteTimeout {
+ public int ReadWriteTimeout {
get { return readWriteTimeout; }
set {
if (requestSent)
get { return proxy; }
set {
CheckRequestStarted ();
-#if ONLY_1_1
- if (value == null)
- throw new ArgumentNullException ("value");
-#endif
-
proxy = value;
servicePoint = null; // we may need a new one
}
}
}
-#if NET_2_0
public override bool UseDefaultCredentials
{
get { return CredentialCache.DefaultCredentials == Credentials; }
set { Credentials = value ? CredentialCache.DefaultCredentials : null; }
}
-#endif
public string UserAgent {
get { return webHeaders ["User-Agent"]; }
set { webHeaders.SetInternal ("User-Agent", value); }
}
-#if NET_1_1
bool unsafe_auth_blah;
public bool UnsafeAuthenticatedConnectionSharing
{
get { return unsafe_auth_blah; }
set { unsafe_auth_blah = value; }
}
-#endif
internal bool GotRequestStream {
get { return gotRequestStream; }
throw new InvalidOperationException ("rangeSpecifier");
webHeaders.RemoveAndAdd ("Range", value + from + "-" + to);
}
-#if !NET_2_0
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-#endif
public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
{
if (method == null)
throw new ProtocolViolationException ("Method is null.");
-#if !NET_2_0
- bool send = !(method == "GET" || method == "CONNECT" || method == "HEAD" ||
- method == "TRACE" || method == "DELETE");
- if (send && contentLength < 0 && !sendChunked && !allowBuffering && KeepAlive)
- throw new ProtocolViolationException ("Buffering is disabled, ContentLength is negative and SendChunked is disabled.");
-
- if (!send && (contentLength > -1 || sendChunked))
- throw new ProtocolViolationException ("ContentLength can't be set for non-write operations.");
-#endif
-
string transferEncoding = TransferEncoding;
if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")
throw new ProtocolViolationException ("SendChunked should be true.");
GetObjectData (serializationInfo, streamingContext);
}
-#if NET_2_0
- protected override
-#endif
- void GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
+ protected override void GetObjectData (SerializationInfo serializationInfo,
+ StreamingContext streamingContext)
{
SerializationInfo info = serializationInfo;
webHeaders.SetInternal ("Cookie", cookieHeader);
}
-#if NET_2_0
string accept_encoding = null;
if ((auto_decomp & DecompressionMethods.GZip) != 0)
accept_encoding = "gzip";
accept_encoding = accept_encoding != null ? "gzip, deflate" : "deflate";
if (accept_encoding != null)
webHeaders.RemoveAndAdd ("Accept-Encoding", accept_encoding);
-#endif
+
if (!usedPreAuth && preAuthenticate)
DoPreAuthenticate ();
ICredentials creds = (!isProxy) ? credentials : proxy.Credentials;
if (creds != null) {
cnc.NtlmCredential = creds.GetCredential (requestUri, "NTLM");
-#if NET_1_1
cnc.UnsafeAuthenticatedConnectionSharing = unsafe_auth_blah;
-#endif
}
}
r.Reset ();
using System.Collections;
using System.Globalization;
using System.IO;
+using System.IO.Compression;
using System.Net.Sockets;
using System.Runtime.Serialization;
using System.Text;
-#if NET_2_0
-using System.IO.Compression;
-#endif
namespace System.Net
{
+#if MOONLIGHT
+ internal class HttpWebResponse : WebResponse, ISerializable, IDisposable {
+#else
[Serializable]
- public class HttpWebResponse : WebResponse, ISerializable, IDisposable
- {
+ public class HttpWebResponse : WebResponse, ISerializable, IDisposable {
+#endif
Uri uri;
WebHeaderCollection webHeaders;
CookieCollection cookieCollection;
try {
string cl = webHeaders ["Content-Length"];
-#if NET_2_0
if (String.IsNullOrEmpty (cl) || !Int64.TryParse (cl, out contentLength))
contentLength = -1;
-#else
- if (cl != null && cl != String.Empty)
- contentLength = (long) UInt64.Parse (cl);
-#endif
} catch (Exception) {
contentLength = -1;
}
this.cookie_container = container;
FillCookies ();
}
-#if NET_2_0
+
string content_encoding = webHeaders ["Content-Encoding"];
if (content_encoding == "gzip" && (data.request.AutomaticDecompression & DecompressionMethods.GZip) != 0)
stream = new GZipStream (stream, CompressionMode.Decompress);
else if (content_encoding == "deflate" && (data.request.AutomaticDecompression & DecompressionMethods.Deflate) != 0)
stream = new DeflateStream (stream, CompressionMode.Decompress);
-#endif
}
-#if NET_2_0
[Obsolete ("Serialization is obsoleted for this type", false)]
-#endif
protected HttpWebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
SerializationInfo info = serializationInfo;
public override WebHeaderCollection Headers {
get {
-#if ONLY_1_1
- CheckDisposed ();
-#endif
return webHeaders;
}
}
-#if NET_2_0
static Exception GetMustImplement ()
{
return new NotImplementedException ();
throw GetMustImplement ();
}
}
-#endif
public DateTime LastModified {
get {
}
// Methods
-#if !NET_2_0
- public override int GetHashCode ()
- {
- return base.GetHashCode ();
- }
-#endif
public string GetResponseHeader (string headerName)
{
GetObjectData (serializationInfo, streamingContext);
}
-#if NET_2_0
- protected override
-#endif
- void GetObjectData (SerializationInfo serializationInfo,
- StreamingContext streamingContext)
+ protected override void GetObjectData (SerializationInfo serializationInfo,
+ StreamingContext streamingContext)
{
SerializationInfo info = serializationInfo;
GC.SuppressFinalize (this);
}
-#if !NET_2_0
- protected virtual
-#endif
void Dispose (bool disposing)
{
if (this.disposed)
if (disposing) {
// release managed resources
uri = null;
-#if !NET_2_0
- webHeaders = null;
-#endif
cookieCollection = null;
method = null;
version = null;
if (cookie.Domain == "")
cookie.Domain = val;
break;
-#if NET_2_0
case "HTTPONLY":
cookie.HttpOnly = true;
break;
-#endif
case "MAX-AGE": // RFC Style Set-Cookie2
if (cookie.Expires == DateTime.MinValue) {
try {
DateTime cookieExpiresUtc = DateTime.ParseExact (value, cookieExpiresFormats [i], CultureInfo.InvariantCulture);
//convert UTC/GMT time to local time
-#if NET_2_0
cookieExpiresUtc = DateTime.SpecifyKind (cookieExpiresUtc, DateTimeKind.Utc);
return TimeZone.CurrentTimeZone.ToLocalTime (cookieExpiresUtc);
-#else
- //DateTime.Kind is only available on .NET 2.0, so do some calculation
- TimeSpan localOffset = TimeZone.CurrentTimeZone.GetUtcOffset (cookieExpiresUtc.Date);
- return cookieExpiresUtc.Add (localOffset);
-#endif
} catch {}
}
// <remarks>
// Authentication interface for Web client authentication modules.
// </remarks>
- public interface IAuthenticationModule
- {
+#if MOONLIGHT
+ internal interface IAuthenticationModule {
+#else
+ public interface IAuthenticationModule {
+#endif
Authorization Authenticate (string challenge, WebRequest request, ICredentials credentials);
Authorization PreAuthenticate (WebRequest request, ICredentials credentials);
string AuthenticationType { get; }
namespace System.Net {
- // <remarks>
- // </remarks>
+#if MOONLIGHT
+ internal interface ICertificatePolicy {
+#else
public interface ICertificatePolicy {
+#endif
bool CheckValidationResult (
ServicePoint srvPoint,
X509Certificate certificate,
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
-
namespace System.Net {
+#if MOONLIGHT
+ internal interface ICredentialPolicy {
+#else
public interface ICredentialPolicy {
-
+#endif
bool ShouldSendCredential (Uri challengeUri,
WebRequest request,
NetworkCredential credential,
}
}
-#endif
namespace System.Net {
- // <remarks>
- // </remarks>
+#if MOONLIGHT && INSIDE_SYSTEM
+ internal interface IWebRequestCreate {
+#else
public interface IWebRequestCreate {
+#endif
WebRequest Create (Uri uri);
}
}
protocolVersion = version;
}
-#if !MOONLIGHT && !TARGET_JVM
+#if !TARGET_JVM
WebConnectionGroup GetConnectionGroup (string name)
{
if (name == null)
namespace System.Net
{
- public class ServicePointManager
- {
+#if MOONLIGHT
+ internal class ServicePointManager {
+#else
+ public class ServicePointManager {
+#endif
class SPKey {
Uri uri; // schema/host/port
bool use_connect;
public const int DefaultNonPersistentConnectionLimit = 4;
public const int DefaultPersistentConnectionLimit = 2;
-#if !MONOTOUCH
+#if !NET_2_1
const string configKey = "system.net/connectionManagement";
static ConnectionManagementData manager;
#endif
static ServicePointManager ()
{
-#if !MONOTOUCH
+#if !NET_2_1
#if NET_2_0 && CONFIGURATION_DEP
object cfg = ConfigurationManager.GetSection (configKey);
ConnectionManagementSection s = cfg as ConnectionManagementSection;
throw new InvalidOperationException ("maximum number of service points reached");
string addr = address.ToString ();
-#if MONOTOUCH
+#if NET_2_1
int limit = defaultConnectionLimit;
#else
int limit = (int) manager.GetMaxConnections (addr);
\r
namespace System.Net \r
{\r
+#if MOONLIGHT && INSIDE_SYSTEM\r
+ internal class WebException : InvalidOperationException, ISerializable {\r
+#else\r
[Serializable]\r
- public class WebException : InvalidOperationException, ISerializable\r
- {\r
+ public class WebException : InvalidOperationException, ISerializable {\r
+#endif\r
private WebResponse response;\r
private WebExceptionStatus status = WebExceptionStatus.UnknownError;\r
\r
}\r
#endif \r
\r
-#if NET_2_0\r
public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
base.GetObjectData (serializationInfo,\r
streamingContext);\r
}\r
-#endif\r
}\r
}\r
using System;
using System.Collections;
-#if NET_2_0
using System.Collections.Generic;
-#endif
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.Net
{
+#if MOONLIGHT
+ internal class WebHeaderCollection : NameValueCollection, ISerializable {
+#else
[Serializable]
[ComVisible(true)]
- public class WebHeaderCollection : NameValueCollection, ISerializable
- {
+ public class WebHeaderCollection : NameValueCollection, ISerializable {
+#endif
private static readonly Hashtable restricted;
private static readonly Hashtable multiValue;
-#if NET_2_0
static readonly Dictionary<string, bool> restricted_response;
-#endif
private bool internallyCreated = false;
// Static Initializer
restricted.Add ("proxy-connection", true);
//
-#if NET_2_0
restricted_response = new Dictionary<string, bool> (StringComparer.InvariantCultureIgnoreCase);
restricted_response.Add ("Content-Length", true);
restricted_response.Add ("Transfer-Encoding", true);
restricted_response.Add ("WWW-Authenticate", true);
-#endif
+
// see par 14 of RFC 2068 to see which header names
// accept multiple values each separated by a comma
multiValue = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
return restricted.ContainsKey (headerName);
}
-#if NET_2_0
public static bool IsRestricted (string headerName, bool response)
{
if (String.IsNullOrEmpty (headerName))
return restricted_response.ContainsKey (headerName);
return restricted.ContainsKey (headerName);
}
-#endif
public override void OnDeserialization (object sender)
{
return(base.GetKey (index));
}
-#if NET_2_0
public void Add (HttpRequestHeader header, string value)
{
Add (RequestHeaderToString (header), value);
{
return(base.GetEnumerator ());
}
-#endif
// Internal Methods
using System.Security.Principal;
#endif
-#if MONOTOUCH
+#if NET_2_1
using ConfigurationException = System.ArgumentException;
namespace System.Net.Configuration {
namespace System.Net
{
+#if MOONLIGHT
+ internal abstract class WebRequest : ISerializable {
+#else
[Serializable]
- public abstract class WebRequest : MarshalByRefObject, ISerializable
- {
+ public abstract class WebRequest : MarshalByRefObject, ISerializable {
+#endif
static HybridDictionary prefixes = new HybridDictionary ();
#if NET_2_0
static bool isDefaultWebProxySet;
static WebRequest ()
{
-#if MONOTOUCH
+#if NET_2_1
AddPrefix ("http", typeof (HttpRequestCreator));
AddPrefix ("https", typeof (HttpRequestCreator));
+ #if MONOTOUCH
AddPrefix ("file", typeof (FileWebRequestCreator));
AddPrefix ("ftp", typeof (FtpRequestCreator));
+ #endif
#else
-#if NET_2_0 && CONFIGURATION_DEP
+ #if NET_2_0 && CONFIGURATION_DEP
object cfg = ConfigurationManager.GetSection ("system.net/webRequestModules");
WebRequestModulesSection s = cfg as WebRequestModulesSection;
if (s != null) {
AddPrefix (el.Prefix, el.Type);
return;
}
-#endif
+ #endif
ConfigurationSettings.GetConfig ("system.net/webRequestModules");
#endif
}
set { throw GetMustImplement (); }
}
-#if NET_2_0
+#if NET_2_0 && !MOONLIGHT
public TokenImpersonationLevel ImpersonationLevel {
get { throw GetMustImplement (); }
set { throw GetMustImplement (); }
\r
namespace System.Net \r
{\r
+#if MOONLIGHT\r
+ internal abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable {\r
+#else\r
[Serializable]\r
- public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable\r
- {\r
+ public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable {\r
+#endif\r
// Constructors\r
\r
protected WebResponse () { }\r
get { throw new NotSupportedException (); }\r
}\r
\r
-#if NET_2_0\r
static Exception GetMustImplement ()\r
{\r
return new NotImplementedException ();\r
throw GetMustImplement ();\r
}\r
}\r
-#endif\r
\r
public virtual Uri ResponseUri { \r
get { throw new NotSupportedException (); }\r
throw new NotSupportedException ();\r
}\r
\r
-#if NET_2_0\r
[MonoTODO]\r
protected virtual void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)\r
{\r
throw GetMustImplement ();\r
}\r
-#endif\r
}\r
}\r
+2010-03-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Timer.cs: Removed old NET_2_0 defines and added some new
+ MOONLIGHT defines (needed for the client stack)
+
2009-09-29 Sebastien Pouliot <sebastien@ximian.com>
* Timer_2_1.cs: Removed. No longer needed by Moonlight
namespace System.Timers
{
+#if MOONLIGHT
+ internal class Timer {
+#else
[DefaultEventAttribute("Elapsed")]
[DefaultProperty("Interval")]
- public class Timer : Component, ISupportInitialize
- {
+ public class Timer : Component, ISupportInitialize {
+#endif
double interval;
bool autoReset;
System.Threading.Timer timer;
public Timer (double interval)
{
-#if NET_2_0
// MSBUG: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296761
if (interval > 0x7FFFFFFF)
throw new ArgumentException ("Invalid value: " + interval, "interval");
-#endif
autoReset = true;
Interval = interval;
}
}
+#if !MOONLIGHT
public override ISite Site
{
get { return base.Site; }
set { base.Site = value; }
}
-
+#endif
[DefaultValue(null)]
[TimersDescriptionAttribute("The object used to marshal the event handler calls issued " +
"when an interval has elapsed.")]
-#if NET_2_0
[Browsable (false)]
-#endif
public ISynchronizeInvoke SynchronizingObject
{
get { return so; }
Enabled = false;
}
+#if MOONLIGHT
+ protected void Dispose (bool disposing)
+ {
+ Close ();
+ }
+#else
protected override void Dispose (bool disposing)
{
Close ();
base.Dispose (disposing);
}
+#endif
static void Callback (object state)
{
+2010-03-19 Sebastien Pouliot <sebastien@ximian.com>
+
+ * Uri.cs: Remove some MOONLIGHT defines
+
2010-03-16 Jb Evain <jbevain@novell.com>
* Uri.cs, UriTypeConverter.cs: use MOONLIGHT symbol to
return host;
}
}
-#if !MOONLIGHT
+
public UriHostNameType HostNameType {
get {
EnsureAbsoluteUri ();
}
}
-#endif // NET_2_1
-
public bool IsDefaultPort {
get {
EnsureAbsoluteUri ();
}
}
-#if !MOONLIGHT
public bool IsLoopback {
get {
EnsureAbsoluteUri ();
}
}
-#endif // NET_2_1
-
public bool IsUnc {
// rule: This should be true only if
// - uri string starts from "\\", or
../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/MonoTODOAttribute.cs
+../corlib/System.Collections/CollectionDebuggerView.cs
+../corlib/System.Collections.Generic/CollectionDebuggerView.cs
#include moonlight_raw_System.dll.sources
Assembly/AssemblyInfo.cs
+Mono.Http/NtlmClient.cs
System.CodeDom.Compiler/GeneratedCodeAttribute.cs
System.Collections.Generic/ISet.cs
System.Collections.Generic/LinkedList.cs
System.Collections.Generic/Stack.cs
System.Collections.Specialized/BitVector32.cs
System.Collections.Specialized/CollectionsUtil.cs
+System.Collections.Specialized/IOrderedDictionary.cs
System.Collections.Specialized/ListDictionary.cs
System.Collections.Specialized/HybridDictionary.cs
+System.Collections.Specialized/NameObjectCollectionBase.cs
+System.Collections.Specialized/NameValueCollection.cs
+System.Collections.Specialized/OrderedDictionary.cs
+System.Collections.Specialized/StringCollection.cs
System.Collections.Specialized/StringDictionary.cs
+System.Collections.Specialized/StringEnumerator.cs
System.ComponentModel/AsyncCompletedEventArgs.cs
System.ComponentModel/AsyncCompletedEventHandler.cs
System.ComponentModel/AsyncOperation.cs
System.ComponentModel/AsyncOperationManager.cs
System.ComponentModel/BackgroundWorker.cs
+System.ComponentModel/BrowsableAttribute.cs
System.ComponentModel/CancelEventArgs.cs
System.ComponentModel/CategoryAttribute.cs
System.ComponentModel/ComponentCollection.cs
+System.ComponentModel/DefaultEventAttribute.cs
+System.ComponentModel/DefaultPropertyAttribute.cs
System.ComponentModel/DefaultValueAttribute.cs
System.ComponentModel/DescriptionAttribute.cs
System.ComponentModel/DoWorkEventHandler.cs
System.ComponentModel/DoWorkEventArgs.cs
+System.ComponentModel/EditorAttribute.cs
System.ComponentModel/EditorBrowsableAttribute.cs
System.ComponentModel/EditorBrowsableState.cs
System.ComponentModel/IChangeTracking.cs
System.ComponentModel/InvalidEnumArgumentException.cs
System.ComponentModel/IRevertibleChangeTracking.cs
System.ComponentModel/ISite.cs
+System.ComponentModel/ISynchronizeInvoke.cs
System.ComponentModel/ITypeDescriptorContext.cs
System.ComponentModel/ListSortDirection.cs
System.ComponentModel/ProgressChangedEventHandler.cs
System.ComponentModel/PropertyChangedEventHandler.cs
System.ComponentModel/PropertyDescriptor.cs
System.ComponentModel/ReadOnlyAttribute.cs
+System.ComponentModel/RecommendedAsConfigurableAttribute.cs
System.ComponentModel/RunWorkerCompletedEventArgs.cs
System.ComponentModel/RunWorkerCompletedEventHandler.cs
System.ComponentModel/TypeConverterAttribute.cs
System/FtpStyleUriParser.cs
System/GenericUriParser.cs
System/GenericUriParserOptions.cs
+System/GopherStyleUriParser.cs
System/HttpStyleUriParser.cs
System/UriIdnScope.cs
System/UriTypeConverter.cs
+System.IO.Compression/CompressionMode.cs
+System.IO.Compression/DeflateStream.cs
+System.IO.Compression/GZipStream.cs
+System.IO/ErrorEventArgs.cs
+System.IO/ErrorEventHandler.cs
+System.IO/FileAction.cs
+System.IO/FileSystemEventArgs.cs
+System.IO/FileSystemEventHandler.cs
+System.IO/InternalBufferOverflowException.cs
+System.IO/InvalidDataException.cs
+System.IO/IODescriptionAttribute.cs
+System.IO/MonoIO.cs
+System.IO/MonoIOError.cs
+System.IO/MonoSyncFileStream.cs
+System.IO/NotifyFilters.cs
+System.IO/RenamedEventArgs.cs
+System.IO/RenamedEventHandler.cs
+System.IO/SearchPattern.cs
+System.IO/WaitForChangedResult.cs
+System.IO/WatcherChangeTypes.cs
+System/IUriData.cs
+System/LdapStyleUriParser.cs
+System.Net/AuthenticationManager.cs
+System.Net/AuthenticationSchemes.cs
+System.Net/AuthenticationSchemeSelector.cs
+System.Net/Authorization.cs
+System.Net/BasicClient.cs
+System.Net/BindIPEndPoint.cs
+System.Net.Cache/HttpCacheAgeControl.cs
+System.Net.Cache/HttpRequestCacheLevel.cs
+System.Net.Cache/HttpRequestCachePolicy.cs
+System.Net.Cache/RequestCacheLevel.cs
+System.Net.Cache/RequestCachePolicy.cs
+System.Net/ChunkedInputStream.cs
+System.Net/ChunkStream.cs
+System.Net/ConnectionModes.cs
+System.Net/CookieCollection.cs
+System.Net/CookieContainer.cs
+System.Net/Cookie.cs
+System.Net/CookieException.cs
+System.Net/CredentialCache.cs
+System.Net/DecompressionMethods.cs
+System.Net/DefaultCertificatePolicy.cs
+System.Net/DigestClient.cs
+System.Net/Dns.cs
+System.Net/DnsEndPoint.cs
+System.Net/EndPoint.cs
+System.Net/GlobalProxySelection.cs
+System.Net/HttpConnection.cs
+System.Net/HttpContinueDelegate.cs
+System.Net/HttpRequestCreator.cs
+System.Net/HttpRequestHeader.cs
+System.Net/HttpResponseHeader.cs
+System.Net/HttpStatusCode.cs
+System.Net/HttpStreamAsyncResult.cs
+System.Net/HttpUtility.cs
+System.Net/HttpVersion.cs
+System.Net/HttpWebRequest.cs
+System.Net/HttpWebResponse.cs
+System.Net/IAuthenticationModule.cs
+System.Net/ICertificatePolicy.cs
+System.Net/ICredentialLookup.cs
+System.Net/ICredentialPolicy.cs
+System.Net/ICredentialsByHost.cs
System.Net/IPAddress.cs
+System.Net/IPEndPoint.cs
+System.Net/IPHostEntry.cs
System.Net/IPv6Address.cs
+System.Net/IWebProxy.cs
+System.Net/IWebProxyScript.cs
+System.Net/IWebRequestCreate.cs
+System.Net/ListenerAsyncResult.cs
+System.Net/ListenerPrefix.cs
+System.Net/MonoHttpDate.cs
+System.Net/NetworkAccess.cs
+System.Net/NetworkCredential.cs
+System.Net/NtlmClient.cs
+System/NetPipeStyleUriParser.cs
+System.Net/ProtocolViolationException.cs
+System.Net/RequestStream.cs
+System.Net/ResponseStream.cs
+System.Net.Security/AuthenticatedStream.cs
+System.Net.Security/AuthenticationLevel.cs
+System.Net.Security/LocalCertificateSelectionCallback.cs
+System.Net.Security/ProtectionLevel.cs
+System.Net/SecurityProtocolType.cs
+System.Net.Security/RemoteCertificateValidationCallback.cs
+System.Net.Security/SslStream.cs
+System.Net.Security/SslPolicyErrors.cs
+System.Net/ServicePoint.cs
+System.Net/ServicePointManager.cs
+System.Net/SocketAddress.cs
System.Net.Sockets/AddressFamily.cs
+System.Net.Sockets/IOControlCode.cs
+System.Net.Sockets/IPv6MulticastOption.cs
+System.Net.Sockets/IPPacketInformation.cs
+System.Net.Sockets/LingerOption.cs
+System.Net.Sockets/MulticastOption.cs
+System.Net.Sockets/NetworkStream.cs
+System.Net.Sockets/ProtocolFamily.cs
+System.Net.Sockets/ProtocolType.cs
+System.Net.Sockets/SelectMode.cs
+System.Net.Sockets/SendPacketsElement.cs
+System.Net.Sockets/Socket.cs
+System.Net.Sockets/Socket_2_1.cs
+System.Net.Sockets/SocketAsyncEventArgs.cs
+System.Net.Sockets/SocketAsyncOperation.cs
+System.Net.Sockets/SocketError.cs
+../System.Net/System.Net.Sockets/SocketException_2_1.cs
+System.Net.Sockets/SocketFlags.cs
+System.Net.Sockets/SocketInformation.cs
+System.Net.Sockets/SocketInformationOptions.cs
+System.Net.Sockets/SocketOptionLevel.cs
+System.Net.Sockets/SocketOptionName.cs
+System.Net.Sockets/SocketShutdown.cs
+System.Net.Sockets/SocketType.cs
+System.Net.Sockets/TcpClient.cs
+System.Net.Sockets/TcpListener.cs
+System.Net.Sockets/TransmitFileOptions.cs
+System.Net.Sockets/UdpClient.cs
+System/NetTcpStyleUriParser.cs
+System.Net/TransportType.cs
+System.Net/WebAsyncResult.cs
+System.Net/WebConnection.cs
+System.Net/WebConnectionData.cs
+System.Net/WebConnectionGroup.cs
+System.Net/WebConnectionStream.cs
+System.Net/WebException.cs
+System.Net/WebExceptionStatus.cs
+System.Net/WebHeaderCollection.cs
+System.Net/WebProxy.cs
+System.Net/WebRequest.cs
+System.Net/WebRequestMethods.cs
+System.Net/WebResponse.cs
+System/NewsStyleUriParser.cs
+System.Security.Authentication/AuthenticationException.cs
+System.Security.Authentication/CipherAlgorithmType.cs
+System.Security.Authentication/ExchangeAlgorithmType.cs
+System.Security.Authentication/HashAlgorithmType.cs
+System.Security.Authentication/SslProtocols.cs
+System.Security.Authentication/InvalidCredentialException.cs
+System.Security.Cryptography.X509Certificates/OpenFlags.cs
+System.Security.Cryptography.X509Certificates/PublicKey.cs
+System.Security.Cryptography.X509Certificates/StoreLocation.cs
+System.Security.Cryptography.X509Certificates/StoreName.cs
+System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs
+System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs
+System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtension.cs
+System.Security.Cryptography.X509Certificates/X509Certificate2Collection.cs
+System.Security.Cryptography.X509Certificates/X509Certificate2.cs
+System.Security.Cryptography.X509Certificates/X509Certificate2Enumerator.cs
+System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs
+System.Security.Cryptography.X509Certificates/X509Chain.cs
+System.Security.Cryptography.X509Certificates/X509ChainElementCollection.cs
+System.Security.Cryptography.X509Certificates/X509ChainElement.cs
+System.Security.Cryptography.X509Certificates/X509ChainElementEnumerator.cs
+System.Security.Cryptography.X509Certificates/X509ChainPolicy.cs
+System.Security.Cryptography.X509Certificates/X509ChainStatus.cs
+System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs
+System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs
+System.Security.Cryptography.X509Certificates/X509ExtensionCollection.cs
+System.Security.Cryptography.X509Certificates/X509Extension.cs
+System.Security.Cryptography.X509Certificates/X509ExtensionEnumerator.cs
+System.Security.Cryptography.X509Certificates/X509FindType.cs
+System.Security.Cryptography.X509Certificates/X509IncludeOption.cs
+System.Security.Cryptography.X509Certificates/X509KeyUsageExtension.cs
+System.Security.Cryptography.X509Certificates/X509KeyUsageFlags.cs
+System.Security.Cryptography.X509Certificates/X509NameType.cs
+System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs
+System.Security.Cryptography.X509Certificates/X509RevocationMode.cs
+System.Security.Cryptography.X509Certificates/X509Store.cs
+System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtension.cs
+System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs
+System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs
System/SRDescriptionAttribute.cs
System.Text.RegularExpressions/arch.cs
System.Text.RegularExpressions/BaseMachine.cs
System.Text.RegularExpressions/RxOp.cs
System.Text.RegularExpressions/replace.cs
System.Text.RegularExpressions/syntax.cs
+System.Timers/ElapsedEventArgs.cs
+System.Timers/ElapsedEventHandler.cs
+System.Timers/Timer.cs
+System.Timers/TimersDescriptionAttribute.cs
System/UriBuilder.cs
System/UriComponents.cs
System/Uri.cs
+System/UriData.cs
System/UriFormat.cs
System/UriFormatException.cs
System/UriHostNameType.cs
System/UriKind.cs
System/UriParser.cs
System/UriPartial.cs
-
-../corlib/System.Collections/CollectionDebuggerView.cs
-../corlib/System.Collections.Generic/CollectionDebuggerView.cs