Пример #1
0
 public UserState(bool updated, string sourceFullname, string destinationFullname, long fileLength, DateTime startCopying, DeployEntry entry)
 {
     this.Updated = updated; this.SourceFullname = sourceFullname;
     this.DestinationFullname = destinationFullname; this.Length = new FileLength(fileLength);
     this.StartCopying = startCopying;
     this.Entry = entry;
 }
Пример #2
0
        public static DeployEntry Parse(XElement item)
        {
            if (item == null || item.Name != strDeployEntry) { return null; }

            var result = new DeployEntry();
            var source = item.Element(strSource);
            result.Source = Transporter.Parse(source.Element(Transporter.strTransporter));
            var dest = item.Element(strDestinationDir);
            result.DestinationDir = Transporter.Parse(dest.Element(Transporter.strTransporter));

            return result;
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.entry == null)
            {
                MessageBox.Show("No entry found, modification won't work.", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            var entry = this.entry.Clone() as DeployEntry;
            entry.Source = this.txtSource.Tag as Transporter;
            entry.Source.Goods = this.txtSource.Text;
            entry.DestinationDir = this.txtDest.Tag as Transporter;
            entry.DestinationDir.Goods = this.txtDest.Text;
            var message = string.Empty;
            if (entry.Conflicts(ref message))
            {
                MessageBox.Show(message, "Conflict!");
                return;
            }

            entry = this.entry;
            entry.Source = this.txtSource.Tag as Transporter;
            entry.Source.Goods = this.txtSource.Text;
            entry.DestinationDir = this.txtDest.Tag as Transporter;
            entry.DestinationDir.Goods = this.txtDest.Text;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
 public FormModifyDeployEntry(DeployEntry entry)
 {
     InitializeComponent();
     this.entry = entry;
 }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtSource.Text.Trim() == string.Empty
                || this.txtSource.Tag == null)
            {
                MessageBox.Show("Please select or type in the source.", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            if (this.txtDest.Text.Trim() == string.Empty
                || this.txtDest.Tag == null)
            {
                MessageBox.Show("Please select or type in the destination directory.", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return;
            }
            var source = this.txtSource.Tag as Transporter;
            var dest = this.txtDest.Tag as Transporter;
            source.Goods = this.txtSource.Text;
            dest.Goods = this.txtDest.Text;

            var entry = new DeployEntry()
            {
                Source = source,
                DestinationDir = dest,
            };
            var message = string.Empty;
            if (entry.Conflicts(ref message))
            {
                MessageBox.Show(message, "Conflict!");
                return;
            }
            this.NewDeployEntry = entry;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }