public static void Save(FTPSettings settings) { using (FileStream stream = File.Open(fileName, FileMode.Create)) { XmlSerializer s = new XmlSerializer(typeof(FTPSettings)); s.Serialize(stream, settings); } }
public PluginBody() { try { settings = SettingsManager.Load(); } catch { settings = new FTPSettings(); } }
public FTPSettingsForm(FTPSettings settings) { InitializeComponent(); if (settings == null) return; tServer.Text = settings.Server; tDirectory.Text = settings.Directory; tUrl.Text = settings.Url; tUser.Text = settings.Username; tPassword.Text = settings.Password; }
public FTPSettingsForm(FTPSettings settings) { InitializeComponent(); if (settings == null) { return; } tServer.Text = settings.Server; tDirectory.Text = settings.Directory; tUrl.Text = settings.Url; tUser.Text = settings.Username; tPassword.Text = settings.Password; }
public void ShowSettings() { using (FTPSettingsForm fs = new FTPSettingsForm(settings)) { if (fs.ShowDialog() == DialogResult.OK) { settings = fs.GetSettings(); try { SettingsManager.Save(settings); } catch (Exception ex) { MessageBox.Show("Error while saving ftp settings!\r\n\r\n" + ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }