Ejemplo n.º 1
0
        btnEditTarget_Click(
            object sender,
            RoutedEventArgs e)
        {
            if (lbTargets.SelectedItem != null)
            {
                TargetCollection tc =
                    configuration.CopyGroupInstance.CopyOperation.Targets;
                Target t = tc.Targets[lbTargets.SelectedValue.ToString()];
                Regex  r = new Regex("^ftp://.*/$");

                AddTarget at =
                    new AddTarget(AddTarget.Mode.Edit,
                                  r.IsMatch(t.Location) ? AddTarget.Type.Ftp
                                  : AddTarget.Type.Local);
                at.TargetName     = t.Name;
                at.TargetLocation = t.Location;
                at.TargetAuthenticationCredential = t.AuthorizationCredential;

                if ((at.ShowDialog()).Value)
                {
                    tc.RemoveTarget(t.Name);
                    lbTargets.Items.RemoveAt(lbTargets.SelectedIndex);
                    tc.AddTarget(at.TargetName,
                                 at.TargetLocation,
                                 at.TargetAuthenticationCredential);
                    lbTargets.Items.Add(at.TargetName);
                }
            }
        }
Ejemplo n.º 2
0
        CopyOperation()
        {
            emailNotifications = new EmailErrorNotification();
            targets            = new TargetCollection();

            emailNotifications.AddRecipient("*****@*****.**");
        }
Ejemplo n.º 3
0
        btnRemoveTarget_Click(
            object sender,
            RoutedEventArgs e)
        {
            TargetCollection tc =
                configuration.CopyGroupInstance.CopyOperation.Targets;

            tc.RemoveTarget((string)lbTargets.SelectedItem);
            lbTargets.Items.RemoveAt(lbTargets.SelectedIndex);

            btnRemoveTarget.IsEnabled = btnEditTarget.IsEnabled = false;
        }
Ejemplo n.º 4
0
        SynchronizeBackupConfiguration()
        {
            CopyOperation    co = configuration.CopyGroupInstance.CopyOperation;
            TargetCollection tc = co.Targets;

            tbSourcePath.Text = co.Source.Location;

            foreach (KeyValuePair <string, Target> t in tc.Targets)
            {
                lbTargets.Items.Add(t.Key);
            }

            cbIntervalUnit.SelectedIndex =
                (int)co.ScheduledFor.TimeUnitOfSchedule;
            tbInterval.Text = co.ScheduledFor.ScheduleString;
        }
Ejemplo n.º 5
0
        btnAddFtpTarget_Click(
            object sender,
            RoutedEventArgs e)
        {
            AddTarget at = new AddTarget(AddTarget.Mode.Edit,
                                         AddTarget.Type.Ftp);

            if (at.ShowDialog().Value)
            {
                TargetCollection tc =
                    configuration.CopyGroupInstance.CopyOperation.Targets;

                tc.AddTarget(at.TargetName,
                             at.TargetLocation,
                             at.TargetAuthenticationCredential);
                lbTargets.Items.Add(at.TargetName);
            }
        }