using System.Collections.Generic; namespace RecrownedGTK.Persistence { public struct PreferencesInfo { public PreferenceInfo[] preferences; public void SetPreferences(Dictionary preferences) { this.preferences = new PreferenceInfo[preferences.Count]; int pairIndex = 0; foreach (KeyValuePair item in preferences) { this.preferences[pairIndex] = new PreferenceInfo(item.Key, item.Value); pairIndex++; } } public Dictionary GetPreferences() { Dictionary res = new Dictionary(); for (int prefID = 0; prefID < preferences.Length; prefID++) { res.Add(preferences[prefID].key, preferences[prefID].value); } return res; } public struct PreferenceInfo { public string key, value; public PreferenceInfo(string key, string value) { this.key = key; this.value = value; } } } }