public PackageDeployment(bool isUpgrade = false, string rollbackVersion = "", string versionToDeploy = "", string application = "")
{
this.InitializeComponent();
this.btnDeploy.Enabled = true;
this.btnLoadTFSlabel.Enabled = false;
this.tvCheckList.ExpandAll();
this.BindEnvironmentCombo();
if (isUpgrade)
{
this.tabControl1.TabPages.Remove(this.tabControl1.TabPages[0]);
this.cbxIsRollback.Checked = this.txtConfigPath.ReadOnly = this.txtPackagePath.ReadOnly = true;
this.btnBrowseConfig.Enabled = this.btnBrowsePackage.Enabled = false;
this.rollbackVersionToLog = versionToDeploy;
string sourceFolder = Path.Combine(Settings.Default.TFSWorkingPath, string.Concat(application, "-", rollbackVersion), Constants.AzurePackagesFolderName);
string.Format("Initiated rollback of {0} to {1}", application, rollbackVersion).WriteToLog();
////MessageBox.Show(sourceFolder);
if (!Directory.Exists(sourceFolder))
{
throw new DirectoryNotFoundException("TFS working path is changed, moved or renamed. Cannot continue with rollback.");
}
this.txtPackagePath.Text = Directory.GetFiles(sourceFolder, "*.cspkg", SearchOption.AllDirectories)[0];
this.txtConfigPath.Text = Directory.GetFiles(sourceFolder, "*.cscfg", SearchOption.AllDirectories)[0];
}
}