예제 #1
0
 public static void Save(FTPSettings settings)
 {
     using (FileStream stream = File.Open(fileName, FileMode.Create))
     {
         XmlSerializer s = new XmlSerializer(typeof(FTPSettings));
         s.Serialize(stream, settings);
     }
 }
예제 #2
0
 public static void Save(FTPSettings settings)
 {
     using (FileStream stream = File.Open(fileName, FileMode.Create))
     {
         XmlSerializer s = new XmlSerializer(typeof(FTPSettings));
         s.Serialize(stream, settings);
     }
 }
예제 #3
0
 public PluginBody()
 {
     try
     {
         settings = SettingsManager.Load();
     }
     catch
     {
         settings = new FTPSettings();
     }
 }
예제 #4
0
        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;
        }
예제 #5
0
        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;
        }
예제 #6
0
        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);
                    }
                }
            }
        }