[monodoc] Remove System.Web.dll dependency
authorJeremie Laval <jeremie.laval@gmail.com>
Thu, 19 Apr 2012 17:00:40 +0000 (18:00 +0100)
committerJeremie Laval <jeremie.laval@gmail.com>
Thu, 19 Apr 2012 17:00:40 +0000 (18:00 +0100)
Since this was causing problems for Windows and the calls used (UrlDecode/Encode) could be easily replaced by Uri methods, I just ripped out the dependency althogether.

mcs/tools/monodoc/Makefile
mcs/tools/monodoc/Mono.Documentation/XmlDocUtils.cs
mcs/tools/monodoc/Monodoc/editing.cs
mcs/tools/monodoc/Monodoc/provider.cs

index 757f39a86f76ff641c8e1c1037d02a13c2ebdf92..700a975405bab740c709b3ce974b3d5d627996b8 100644 (file)
@@ -114,10 +114,9 @@ LIB_MCS_FLAGS = \
        /r:$(corlib)                                                      \
        /r:System.dll                                                     \
        /r:System.Core.dll                                                \
-       /r:System.Web                                                     \
-       /r:System.Web.Services                                            \
-       /r:System.Xml.dll                                                 \
-       /r:System.Configuration.dll
+       /r:System.Configuration.dll                                       \
+       /r:System.Web.Services.dll                                        \
+       /r:System.Xml.dll
 
 include ../../build/library.make
 
index 8e890e50a2a1b8ae64a32cd892ff848a19b5061d..2f4cd08f11af3ee4e39b045793f3f57abc3366dd 100644 (file)
@@ -193,7 +193,7 @@ namespace Mono.Documentation {
                public static string GetCachedFileName (string cacheDir, string url)
                {
                        return Path.Combine (cacheDir,
-                                       HttpUtility.UrlEncode (url).Replace ('/', '+').Replace ("*", "%2a"));
+                                            Uri.EscapeUriString (url).Replace ('/', '+').Replace ("*", "%2a"));
                }
        }
 }
index c8b2383cbab6134ad15d712c48f538656b506324..fd7a4b3c147be1a359fe604dd923c046e4620546 100644 (file)
@@ -22,8 +22,8 @@ namespace Monodoc {
                
                public static string FormatEditUri (string document_identifier, string xpath)
                {
-                       return String.Format ("edit:{0}@{1}", HttpUtility.UrlEncode (document_identifier),
-                               HttpUtility.UrlEncode (xpath));
+                       return String.Format ("edit:{0}@{1}", Uri.EscapeUriString (document_identifier),
+                               Uri.EscapeUriString (xpath));
                }
                
                public static string GetXPath (XPathNavigator n)
@@ -157,8 +157,8 @@ namespace Monodoc {
                        if (parts.Length != 2)
                                throw new Exception (String.Format ("invalid editing url {0}", parts.Length));
                        
-                       string xp = HttpUtility.UrlDecode (parts [1]);
-                       parts = HttpUtility.UrlDecode (parts [0]).Substring ("edit:".Length).Split ('@');
+                       string xp = Uri.UnescapeDataString (parts [1]);
+                       parts = Uri.UnescapeDataString (parts [0]).Substring ("edit:".Length).Split ('@');
                        if (parts.Length == 1) {
                                string p = parts[0];
                                parts = new string[2];
index 38db7012efeec287ac428c0b89155613840748ec..9d33338ad8ea340692caca9eedf98ee5e3315410 100644 (file)
@@ -557,7 +557,7 @@ public class HelpSource {
        {
                if (nozip) {
                        Stream s = File.OpenRead (XmlDocUtils.GetCachedFileName (base_dir, id));
-                       string url = "monodoc:///" + SourceID + "@" + System.Web.HttpUtility.UrlEncode (id) + "@";
+                       string url = "monodoc:///" + SourceID + "@" + Uri.EscapeUriString (id) + "@";
                        return new XmlTextReader (url, s);
                }
 
@@ -567,7 +567,7 @@ public class HelpSource {
                ZipEntry entry = zip_file.GetEntry (id);
                if (entry != null) {
                        Stream s = zip_file.GetInputStream (entry);
-                       string url = "monodoc:///" + SourceID + "@" + System.Web.HttpUtility.UrlEncode (id) + "@";
+                       string url = "monodoc:///" + SourceID + "@" + Uri.EscapeUriString (id) + "@";
                        return new XmlTextReader (url, s);
                }
                return null;
@@ -577,7 +577,7 @@ public class HelpSource {
        {
                if (nozip) {
                        Stream s = File.OpenRead (XmlDocUtils.GetCachedFileName (base_dir, id));
-                       string url = "monodoc:///" + SourceID + "@" + System.Web.HttpUtility.UrlEncode (id) + "@";
+                       string url = "monodoc:///" + SourceID + "@" + Uri.EscapeUriString (id) + "@";
                        XmlReader r = new XmlTextReader (url, s);
                        XmlDocument ret = new XmlDocument ();
                        ret.Load (r);
@@ -590,7 +590,7 @@ public class HelpSource {
                ZipEntry entry = zip_file.GetEntry (id);
                if (entry != null) {
                        Stream s = zip_file.GetInputStream (entry);
-                       string url = "monodoc:///" + SourceID + "@" + System.Web.HttpUtility.UrlEncode (id) + "@";
+                       string url = "monodoc:///" + SourceID + "@" + Uri.EscapeUriString (id) + "@";
                        XmlReader r = new XmlTextReader (url, s);
                        XmlDocument ret = new XmlDocument ();
                        ret.Load (r);