public void SetProject(DeployProject project)
 {
     _project = project;
     this.lstSourceList.Items.Clear();
     if (project != null)
     {
         foreach (var item in project)
         {
             this.lstSourceList.Items.Add(item);
         }
     }
 }
 private void DeploySelectedItems(ListBox.SelectedObjectCollection selected,
     bool forceDeploy)
 {
     var project = new DeployProject();
     foreach (var item in selected)
     {
         var entry = item as DeployEntry;
         if (entry != null)
         {
             project.Add(entry);
         }
     }
     var frmDeploy = new FormDeployProcess2(project, new DeployCmd(forceDeploy));
     frmDeploy.ShowDialog(this);
 }
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!this.RegexIsValidFileName(this.txtDeployItemListName.Text))
            {
                MessageBox.Show("文件名非法,请重新输入。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (string.IsNullOrEmpty(this.txtPath.Text))
            {
                MessageBox.Show("请指定要保存的路径。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (!Directory.Exists(this.txtPath.Text))
            {
                MessageBox.Show("您给定的路径不存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (!this.txtDeployItemListName.Text.ToLower().EndsWith(".xml"))
            {
                this.txtDeployItemListName.Text = this.txtDeployItemListName.Text + ".xml";
            }

            this.NewDeployProject = new DeployProject() { Fullname = Path.Combine(this.txtPath.Text,this.txtDeployItemListName.Text) };

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }