public ApplicationMode Load (IContext context)
{
if (_stream != null)
return GetModeFromStream();
string filePath = context.ResolvePath ("~/" + _fileName);
if (!File.Exists (filePath))
return ApplicationMode.Auto;
using (StreamReader sr = new StreamReader (filePath))
{
return sr.ReadLine ().ToEnum(ApplicationMode.Auto);
}
}
private ApplicationMode GetModeFromStream()