DeploymentTracker.App.Windows.PackageDeployment.PackageDeployment C# (CSharp) Method

PackageDeployment() public method

Initializes a new instance of the PackageDeployment class.
public PackageDeployment ( bool isUpgrade = false, string rollbackVersion = "", string versionToDeploy = "", string application = "" ) : System
isUpgrade bool if set to true [is upgrade].
rollbackVersion string The rollback version.
versionToDeploy string The version to deploy.
application string The application.
return System
        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];
            }
        }