Mercurial > repos > IBBoard
annotate Xml/IBBXmlResolver.cs @ 107:0f88d32b22cc
* Swap to built-in .Net methods (listed on http://www.ironshay.com/post/Use-NET-Built-in-Methods-to-Save-Time-and-Headaches.aspx)
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 13 Aug 2011 10:42:57 +0000 |
parents | cc7fae81afec |
children |
rev | line source |
---|---|
16 | 1 // This file (IBBXmlResolver.cs) is a part of the IBBoard library and is copyright 2009 IBBoard. |
2 // | |
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. | |
4 | |
37 | 5 using System; |
6 using System.Xml; | |
7 | |
8 namespace IBBoard.Xml | |
9 { | |
10 /// <summary> | |
11 /// Summary description for IBBXmlResolver. | |
12 /// </summary> | |
13 public class IBBXmlResolver : XmlUrlResolver | |
14 { | |
15 private string baseFilePath = ""; | |
16 | |
17 public IBBXmlResolver(string basePath) | |
18 { | |
19 baseFilePath = basePath; | |
20 } | |
21 | |
22 public override Uri ResolveUri(Uri baseUri, string relativeUri) | |
23 { | |
24 if (relativeUri.StartsWith("dtds/")) | |
25 { | |
26 //Uri uri = base.ResolveUri(baseUri, relativeUri); | |
107
0f88d32b22cc
* Swap to built-in .Net methods (listed on http://www.ironshay.com/post/Use-NET-Built-in-Methods-to-Save-Time-and-Headaches.aspx)
IBBoard <dev@ibboard.co.uk>
parents:
37
diff
changeset
|
27 return new Uri(Uri.UriSchemeFile + "://" + baseFilePath + "/" + relativeUri); |
37 | 28 } |
29 else | |
30 { | |
31 return base.ResolveUri(baseUri, relativeUri); | |
32 } | |
33 } | |
34 } | |
35 } |