mirror of https://github.com/icsharpcode/ILSpy.git
4 changed files with 38 additions and 28 deletions
@ -0,0 +1,34 @@ |
|||||||
|
using System.Xml.Linq; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy.Options |
||||||
|
{ |
||||||
|
public interface IMiscSettingsLoader |
||||||
|
{ |
||||||
|
MiscSettings LoadMiscSettings(ILSpySettings settings); |
||||||
|
} |
||||||
|
|
||||||
|
public class MiscSettingsLoader : IMiscSettingsLoader |
||||||
|
{ |
||||||
|
public MiscSettings LoadMiscSettings(ILSpySettings settings) |
||||||
|
{ |
||||||
|
XElement e = settings["MiscSettings"]; |
||||||
|
MiscSettings s = new MiscSettings(); |
||||||
|
s.AllowMultipleInstances = (bool?)e.Attribute("allowMultipleInstance") ?? s.AllowMultipleInstances; |
||||||
|
return s; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static class MiscSettingsInstance |
||||||
|
{ |
||||||
|
private static MiscSettingsLoader current; |
||||||
|
|
||||||
|
public static MiscSettingsLoader Current |
||||||
|
{ |
||||||
|
get |
||||||
|
{ |
||||||
|
current = current ?? new MiscSettingsLoader(); |
||||||
|
return current; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue