public bool Read(Android.Content.Context context) { var prefs = Android.Preferences.PreferenceManager.GetDefaultSharedPreferences(context); bool hasPrefs = prefs.GetInt("version", 0) > 0; MessageFilterLevel = prefs.GetInt("messageFilterLevel", 2); String musicFolder = prefs.GetString("musicFolder", GetDefaultMusicDirectory().Serialize()); MusicFolder = FolderFactory.CreateFromSerialization(musicFolder).Result; String soundFolder = prefs.GetString("soundFolder", GetDefaultSoundDirectory().Serialize()); SoundFolder = FolderFactory.CreateFromSerialization(soundFolder).Result; String projectFolder = prefs.GetString("projectFolder", GetDefaultProjectDirectory().Serialize()); ProjectFolder = FolderFactory.CreateFromSerialization(projectFolder).Result; GlobalVolume = prefs.GetInt("overallVolume", 100); MusicVolume = prefs.GetInt("musicVolume", 100); SoundVolume = prefs.GetInt("soundVolume", 100); UdpPort = prefs.GetInt("udpPort", 8009); TcpPort = prefs.GetInt("tcpPort", 11112); String lastProject = prefs.GetString("lastProject", String.Empty); if (!String.IsNullOrEmpty(lastProject)) { RecentFiles.AddFile(new RecentFiles.ProjectEntry(lastProject, "Project0")); } TagMusicFadeTime = prefs.GetInt("tagMusicFadeTime", 0); TagMusicFadeOnlyOnChange = prefs.GetBoolean("tagMusicFadeOnlyOnChange", false); ButtonMusicFadeMode = prefs.GetInt("buttonMusicFadeMode", 0); ButtonMusicFadeTime = prefs.GetInt("buttonMusicFadeTime", 0); PlayerName = prefs.GetString("playerName", "Android Player"); return(hasPrefs); }
public static IFolder GetDefaultProjectDirectory() { return(FolderFactory.CreateFileSystemFolder(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + Java.IO.File.Separator + "Ares" + Java.IO.File.Separator + "Projects").Result); }