public static Session Instance () { if (uniqueInstance == null) { uniqueInstance = new Session(); } return uniqueInstance; }
/// <summary> /// Restore the session object. /// </summary> public bool load() { var prefs = Application.Context.GetSharedPreferences ("CompetitieApp2", FileCreationMode.Private); string sessionString = prefs.GetString("Session", null); if (sessionString != null && sessionString.Length > 1) { uniqueInstance = Serialization.DeserializeObject<Session>(sessionString); return true; } return false; }