-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
This is a really cool project.
If the result of the body of the property is null, then the body of the property is called each time.
This could be fixed using a slightly different implementation:
// begin - fields added by the post-compile step
private static Lazy<Settings> _settings = new Lazy<Settings>(() => __Settings);
public static Settings Settings { get { return _settings.Value; } }
// end
// Property is made private and name changed somehow
private static Settings __Settings
{
get
{
using (var fs = File.Open("settings.xml", FileMode.Open))
{
var serializer = new XmlSerializer(typeof(Settings));
return (Settings)serializer.Deserialize(fs);
}
}
}Metadata
Metadata
Assignees
Labels
No labels