示例#1
0
文件: Settings.cs 项目: zBart/Ares
        public void Write(Android.Content.Context context)
        {
            var prefs  = Android.Preferences.PreferenceManager.GetDefaultSharedPreferences(context);
            var editor = prefs.Edit();

            editor.PutInt("version", Version);
            editor.PutInt("messageFilterLevel", MessageFilterLevel);
            editor.PutString("musicFolder", MusicFolder.Serialize());
            editor.PutString("soundFolder", SoundFolder.Serialize());
            editor.PutString("projectFolder", ProjectFolder.Serialize());
            editor.PutInt("overallVolume", GlobalVolume);
            editor.PutInt("musicVolume", MusicVolume);
            editor.PutInt("soundVolume", SoundVolume);
            editor.PutInt("udpPort", UdpPort);
            editor.PutInt("tcpPort", TcpPort);
            editor.PutString("lastProject", RecentFiles.GetFiles().Count > 0 ? RecentFiles.GetFiles()[0].FilePath : String.Empty);
            editor.PutInt("tagMusicFadeTime", TagMusicFadeTime);
            editor.PutBoolean("tagMusicFadeOnlyOnChange", TagMusicFadeOnlyOnChange);
            editor.PutInt("buttonMusicFadeMode", ButtonMusicFadeMode);
            editor.PutInt("buttonMusicFadeTime", ButtonMusicFadeTime);
            editor.PutString("playerName", PlayerName);
            editor.Apply();
        }