private void pnlSaveSettings_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var opciones = new FmSettings
                               {
                                   PushoverUserKey = txtPushUserKey.Text,
                                   PushoverDeviceName = txtPushDeviceName.Text
                               };

            Stream data = new FileStream("Settings.xml", FileMode.Create);

            var marshall = new XmlSerializer(typeof(FmSettings));

            marshall.Serialize(data, opciones);

            App.Opciones = opciones;

            Close();
        }
Exemplo n.º 2
0
        private void LoadOpciones()
        {
            if(File.Exists("Settings.xml"))
            {
                Stream fVault = new FileStream("Settings.xml", FileMode.Open);

                var unMarshall = new XmlSerializer(typeof(FmSettings));
                Opciones = (FmSettings)unMarshall.Deserialize(fVault);

                fVault.Close();
            }
            else
            {
                Opciones = new FmSettings();
            }
        }