Author: igorz
Date: 2006-11-27 04:28:15 -0500 (Mon, 27 Nov 2006)
New Revision: 68496
Modified:
trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI/Control.cs
trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
Log:
2006-11-27 Igor Zelmanovich <[EMAIL PROTECTED]>
* Control.cs: implemented OpenFile()
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2006-11-27 05:00:14 UTC
(rev 68495)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2006-11-27 09:28:15 UTC
(rev 68496)
@@ -1,3 +1,7 @@
+2006-11-27 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * Control.cs: implemented OpenFile()
+
2006-11-26 Igor Zelmanovich <[EMAIL PROTECTED]>
* Page.cs:
Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2006-11-27 05:00:14 UTC
(rev 68495)
+++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2006-11-27 09:28:15 UTC
(rev 68496)
@@ -894,7 +894,13 @@
#if NET_2_0
protected internal Stream OpenFile (string path)
{
- throw new NotImplementedException ();
+ try {
+ string filePath = Context.Server.MapPath (path);
+ return File.OpenRead (filePath);
+ }
+ catch (UnauthorizedAccessException) {
+ throw new HttpException ("Access to the
specified file was denied.");
+ }
}
#endif
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog 2006-11-27
05:00:14 UTC (rev 68495)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ChangeLog 2006-11-27
09:28:15 UTC (rev 68496)
@@ -1,3 +1,7 @@
+2006-11-27 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * ControlTest.cs: removed NotWorking attributes.
+
2006-11-26 Igor Zelmanovich <[EMAIL PROTECTED]>
* ControlTest.cs: removed NotWorking attributes, fixed tests.
Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
2006-11-27 05:00:14 UTC (rev 68495)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
2006-11-27 09:28:15 UTC (rev 68496)
@@ -535,7 +535,6 @@
}
[Test]
- [Category ("NotWorking")] // Not implemented exception
[Category ("NunitWeb")]
public void OpenFile ()
{
@@ -550,7 +549,6 @@
}
[Test]
- [Category ("NotWorking")]
[Category ("NunitWeb")]
[ExpectedException (typeof (FileNotFoundException))]
public void OpenFile_Exception ()
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches