namespace System.Net \r
{\r
[Serializable]\r
- public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable\r
- {\r
+ public abstract class WebResponse : MarshalByRefObject, ISerializable, IDisposable {\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
+ }\r
+ \r
+ [MonoTODO]\r
public virtual bool IsFromCache\r
{\r
get {\r
- throw new NotImplementedException ();\r
+ return false;\r
+ // Better to return false than to kill the application\r
+ // throw GetMustImplement ();\r
}\r
}\r
\r
+ [MonoTODO]\r
public virtual bool IsMutuallyAuthenticated\r
{\r
get {\r
- throw new NotImplementedException ();\r
+ throw GetMustImplement ();\r
}\r
}\r
-#endif\r
\r
public virtual Uri ResponseUri { \r
get { throw new NotSupportedException (); }\r
} \r
\r
+ public virtual bool SupportsHeaders {\r
+ get {\r
+ // The managed stack always returns this as true, it is only\r
+ // the Silverlight stack that does not support this.\r
+ return true;\r
+ }\r
+ }\r
// Methods\r
\r
public virtual void Close()\r
{\r
throw new NotSupportedException ();\r
}\r
-#if TARGET_JVM //enable overrides for extenders\r
- public virtual void Dispose()\r
-#else\r
- void IDisposable.Dispose()\r
-#endif\r
+ public void Dispose ()\r
{\r
- Close ();\r
+ Dispose (true);\r
}\r
-#if TARGET_JVM //enable overrides for extenders\r
- public virtual void GetObjectData\r
-#else\r
+ \r
+ protected virtual void Dispose (bool disposing)\r
+ {\r
+ if (disposing)\r
+ Close ();\r
+ }\r
+\r
void ISerializable.GetObjectData\r
-#endif\r
(SerializationInfo serializationInfo,\r
StreamingContext streamingContext)\r
{\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 new NotImplementedException ();\r
+ throw GetMustImplement ();\r
}\r
-#endif\r
}\r
}\r