Ejemplo n.º 1
0
        /// <summary>
        /// Saves the Email accont settings to a file.
        /// </summary>
        /// <param name="file">The file path to save to.</param>
        /// <param name="c">AccountSettings object.</param>
        public static void Save(string file, AccountSettings c)
        {
            try
            {
                if (File.Exists(file))
                {
                    File.Delete(file);
                }

                // TODO: MAke this binary
                System.Xml.Serialization.XmlSerializer xs
                    = new System.Xml.Serialization.XmlSerializer(c.GetType());
                StreamWriter writer = File.CreateText(file);
                xs.Serialize(writer, c);
                writer.Flush();
                writer.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Method for save the account settings.
 /// </summary>
 public void SaveAccountSettings()
 {
     AccountSettings.Save("Account.Settings", this._accSettings);
     this.Connect();
 }