diff options
Diffstat (limited to 'Mono.Addins')
-rw-r--r-- | Mono.Addins/ChangeLog | 6 | ||||
-rw-r--r-- | Mono.Addins/Mono.Addins.Description/AddinDescription.cs | 7 | ||||
-rw-r--r-- | Mono.Addins/Mono.Addins/AddinRegistry.cs | 10 |
3 files changed, 22 insertions, 1 deletions
diff --git a/Mono.Addins/ChangeLog b/Mono.Addins/ChangeLog index df857cb..89ed935 100644 --- a/Mono.Addins/ChangeLog +++ b/Mono.Addins/ChangeLog @@ -1,3 +1,9 @@ +2008-09-23 Lluis Sanchez Gual <lluis@novell.com> + + * Mono.Addins.Description/AddinDescription.cs, + Mono.Addins/AddinRegistry.cs: Added methods which allow reading a + manifest from a stream. + 2008-09-03 Lluis Sanchez Gual <lluis@novell.com> * Mono.Addins/ExtensionNode.cs: Fix potential race. diff --git a/Mono.Addins/Mono.Addins.Description/AddinDescription.cs b/Mono.Addins/Mono.Addins.Description/AddinDescription.cs index 6f302e7..0643a19 100644 --- a/Mono.Addins/Mono.Addins.Description/AddinDescription.cs +++ b/Mono.Addins/Mono.Addins.Description/AddinDescription.cs @@ -548,11 +548,16 @@ namespace Mono.Addins.Description public static AddinDescription Read (Stream stream, string basePath) { + return Read (new StreamReader (stream), basePath); + } + + public static AddinDescription Read (TextReader reader, string basePath) + { AddinDescription config = new AddinDescription (); try { config.configDoc = new XmlDocument (); - config.configDoc.Load (stream); + config.configDoc.Load (reader); } catch (Exception ex) { throw new InvalidOperationException ("The add-in configuration file is invalid: " + ex.Message, ex); } diff --git a/Mono.Addins/Mono.Addins/AddinRegistry.cs b/Mono.Addins/Mono.Addins/AddinRegistry.cs index a5785e4..80f9586 100644 --- a/Mono.Addins/Mono.Addins/AddinRegistry.cs +++ b/Mono.Addins/Mono.Addins/AddinRegistry.cs @@ -176,6 +176,16 @@ namespace Mono.Addins return desc; } + public AddinDescription ReadAddinManifestFile (TextReader reader, string baseFile) + { + if (currentDomain == AddinDatabase.UnknownDomain) + return null; + AddinDescription desc = AddinDescription.Read (reader, baseFile); + desc.OwnerDatabase = database; + desc.Domain = currentDomain; + return desc; + } + public bool IsAddinEnabled (string id) { if (currentDomain == AddinDatabase.UnknownDomain) |