diff options
author | Jonathan Pryor <jpryor@novell.com> | 2009-09-09 23:34:51 +0400 |
---|---|---|
committer | Jonathan Pryor <jpryor@novell.com> | 2009-09-09 23:34:51 +0400 |
commit | 5d66a7c092614fc84624e60dec7ffc0348815996 (patch) | |
tree | fd552e82d686ed02999e07960842a8068682716c /mcs/tools | |
parent | ce8957f93bc1df247c4c44087502fb38bf6b2957 (diff) |
* Mono.Documentation/ManifestResourceResolver.cs: Allow it to lookup
files located in multiple directories. Needed so that 'mdoc
export-html' can properly deal with multiple source directories.
svn path=/trunk/mcs/; revision=141628
Diffstat (limited to 'mcs/tools')
-rw-r--r-- | mcs/tools/monodoc/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/tools/monodoc/Mono.Documentation/ManifestResourceResolver.cs | 15 |
2 files changed, 15 insertions, 6 deletions
diff --git a/mcs/tools/monodoc/ChangeLog b/mcs/tools/monodoc/ChangeLog index 022043129ef..cb1034c2c60 100644 --- a/mcs/tools/monodoc/ChangeLog +++ b/mcs/tools/monodoc/ChangeLog @@ -1,3 +1,9 @@ +2009-09-09 Jonathan Pryor <jpryor@novell.com> + + * Mono.Documentation/ManifestResourceResolver.cs: Allow it to lookup + files located in multiple directories. Needed so that 'mdoc + export-html' can properly deal with multiple source directories. + 2009-08-13 Jonathan Pryor <jpryor@novell.com> * Monodoc/provider.cs: Add a RootTree.AddSource(string) method, so that diff --git a/mcs/tools/monodoc/Mono.Documentation/ManifestResourceResolver.cs b/mcs/tools/monodoc/Mono.Documentation/ManifestResourceResolver.cs index 60c257ed47c..c4f32653b26 100644 --- a/mcs/tools/monodoc/Mono.Documentation/ManifestResourceResolver.cs +++ b/mcs/tools/monodoc/Mono.Documentation/ManifestResourceResolver.cs @@ -5,11 +5,11 @@ using System.Xml; namespace Mono.Documentation { public class ManifestResourceResolver : XmlUrlResolver { - private string dir; + private string[] dirs; - public ManifestResourceResolver (string dir) + public ManifestResourceResolver (params string[] dirs) { - this.dir = dir; + this.dirs = (string[]) dirs.Clone (); } public override Uri ResolveUri (Uri baseUri, string relativeUri) @@ -18,9 +18,12 @@ namespace Mono.Documentation { if (s != null) return new Uri ("x-resource:///" + relativeUri); } - return base.ResolveUri ( - new Uri ("file://" + new DirectoryInfo (dir).FullName + "/"), - relativeUri); + foreach (var dir in dirs) { + if (File.Exists (Path.Combine (dir, relativeUri))) + return base.ResolveUri (new Uri ("file://" + new DirectoryInfo (dir).FullName + "/"), + relativeUri); + } + return base.ResolveUri (baseUri, relativeUri); } public override object GetEntity (Uri absoluteUri, string role, Type ofObjectToReturn) |