Example #1
0
 private void addToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frmFTP FTPInfo = new frmFTP();
     FTPInfo.Result = false;
     FTPInfo.ShowDialog();
     if (FTPInfo.Result)
     {
         AddItemToList(FTPInfo.SourceFolder, FTPInfo.ServerName + ";" + FTPInfo.UserName + ";" + FTPInfo.Password);
     }
 }
Example #2
0
 private void modifyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lsvOptionsToMonitor.SelectedItems.Count > 0)
     {
         string Source = lsvOptionsToMonitor.SelectedItems[0].SubItems[0].Text;
         string Destination = lsvOptionsToMonitor.SelectedItems[0].SubItems[1].Text;
         string[] DestParts = Destination.Split(new char []{ ';' });
         if (DestParts.Length == 3)
         {
             frmFTP FTPInfo = new frmFTP();
             FTPInfo.SourceFolder = Source;
             FTPInfo.ServerName = DestParts[0];
             FTPInfo.UserName = DestParts[1];
             FTPInfo.Password = DestParts[2];
             FTPInfo.ShowDialog();
             if (FTPInfo.Result)
             {
                 if ((FTPInfo.SourceFolder.CompareTo(Source) != 0) ||
                     (FTPInfo.ServerName.CompareTo(DestParts[0]) != 0) ||
                     (FTPInfo.ServerName.CompareTo(DestParts[1]) != 0) ||
                     (FTPInfo.ServerName.CompareTo(DestParts[2]) != 0))
                 {
                     lsvOptionsToMonitor.SelectedItems[0].SubItems[0].Text = FTPInfo.SourceFolder;
                     lsvOptionsToMonitor.SelectedItems[0].SubItems[1].Text = FTPInfo.ServerName + ";" + FTPInfo.UserName + ";" + FTPInfo.Password;
                     UnSavedValues = true;
                 }
             }
         }
         else
         {
             MessageBox.Show("Entry is not recognized, please delete and recreate.", "Invalid Entry", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }