|
|
@ -267,22 +267,26 @@ namespace ICSharpCode.Core |
|
|
|
|
|
|
|
|
|
|
|
public static AddIn Load(TextReader textReader, string hintPath) |
|
|
|
public static AddIn Load(TextReader textReader, string hintPath) |
|
|
|
{ |
|
|
|
{ |
|
|
|
AddIn addIn = new AddIn(); |
|
|
|
try { |
|
|
|
using (XmlTextReader reader = new XmlTextReader(textReader)) { |
|
|
|
AddIn addIn = new AddIn(); |
|
|
|
while (reader.Read()){ |
|
|
|
using (XmlTextReader reader = new XmlTextReader(textReader)) { |
|
|
|
if (reader.IsStartElement()) { |
|
|
|
while (reader.Read()){ |
|
|
|
switch (reader.LocalName) { |
|
|
|
if (reader.IsStartElement()) { |
|
|
|
case "AddIn": |
|
|
|
switch (reader.LocalName) { |
|
|
|
addIn.properties = Properties.ReadFromAttributes(reader); |
|
|
|
case "AddIn": |
|
|
|
SetupAddIn(reader, addIn, hintPath); |
|
|
|
addIn.properties = Properties.ReadFromAttributes(reader); |
|
|
|
break; |
|
|
|
SetupAddIn(reader, addIn, hintPath); |
|
|
|
default: |
|
|
|
break; |
|
|
|
throw new AddInLoadException("Unknown add-in file."); |
|
|
|
default: |
|
|
|
|
|
|
|
throw new AddInLoadException("Unknown add-in file."); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return addIn; |
|
|
|
|
|
|
|
} catch (XmlException ex) { |
|
|
|
|
|
|
|
throw new AddInLoadException(ex.Message, ex); |
|
|
|
} |
|
|
|
} |
|
|
|
return addIn; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static AddIn Load(string fileName) |
|
|
|
public static AddIn Load(string fileName) |
|
|
|