public void LoadPreferenceData() { //Load from Database.sdf XmlReaderWriter file = new XmlReaderWriter(); file.OpenRead("Preference.xml"); buttons[TEXTBOX_INDEX].Text = file.ReadNextTextNode(); brightness = Int32.Parse(file.ReadNextTextNode()); contrast = Int32.Parse(file.ReadNextTextNode()); Music_Preview.Volume = float.Parse(file.ReadNextTextNode()); Sound_Preview.Volume = float.Parse(file.ReadNextTextNode()); Sound_Preview.Pitch = float.Parse(file.ReadNextTextNode()); Sound_Preview.Pan = float.Parse(file.ReadNextTextNode()); graphics.IsFullScreen = Boolean.Parse(file.ReadNextTextNode()); file.ReadClose(); graphics.ApplyChanges(); }