private void BtEnvListOnButtonPressed(object sender, EventArgs eventArgs) { AppliMenu.ShowEnvMenu(true); }
public DoDeployPage() { InitializeComponent(); // browse btBrowse.BackGrndImage = ImageResources.SelectFile; btBrowse.ButtonPressed += BtBrowseOnButtonPressed; tooltip.SetToolTip(btBrowse, "Click to <b>select</b> a folder"); // open btOpen.BackGrndImage = ImageResources.OpenInExplorer; btOpen.ButtonPressed += BtOpenOnButtonPressed; tooltip.SetToolTip(btOpen, "Click to <b>open</b> this folder in the explorer"); // historic btHistoric.BackGrndImage = ImageResources.Historic; btHistoric.ButtonPressed += BtHistoricOnButtonPressed; tooltip.SetToolTip(btHistoric, "Click to <b>browse</b> the previous folders"); if (string.IsNullOrEmpty(Config.Instance.CompileDirectoriesHistoric)) { btHistoric.Visible = false; } tooltip.SetToolTip(toggleRecurs, "Toggle this option on to explore recursively the selected folder<br>Toggle off and you will only compile/deploy the files directly under the selected folder"); tooltip.SetToolTip(toggleAutoUpdateSourceDir, "Automatically update the above directory when you switch environment<br>(it then takes the source directory of the environment)"); tooltip.SetToolTip(toggleMono, "Toggle on to only use a single process when compiling during the deployment<br>Obviously, this will slow down the process by a lot!<br>The only reason to use this option is if you want to limit the number of connections made to your database during compilation..."); tooltip.SetToolTip(toggleOnlyGenerateRcode, "Override the environment settings and only generated R-code during the deployement<br>(i.e. dont deploy debug-list or xref)"); tooltip.SetToolTip(fl_nbProcess, "This parameter is used when compiling multiple files, it determines how many<br>Prowin processes can be started to handle compilation<br>The total number of processes started is actually multiplied by your number of cores<br><br>Be aware that as you increase the number or processes for the compilation, you<br>decrease the potential time of compilation but you also increase the number of connection<br>needed to your database (if you have one defined!)<br>You might have an error on certain processes that can't connect to the database<br>if you try to increase this number too much<br><br><i>This value can't be superior to 15</i>"); // Open hook btOpenHook.BackGrndImage = ImageResources.Edit; btOpenHook.ButtonPressed += (sender, args) => { if (!File.Exists(Config.FileDeploymentHook)) { Utils.FileWriteAllBytes(Config.FileDeploymentHook, DataResources.DeploymentHook); } Npp.OpenFile(Config.FileDeploymentHook); }; // diretory from env btUndo.BackGrndImage = ImageResources.UndoUserAction; btUndo.ButtonPressed += BtUndoOnButtonPressed; tooltip.SetToolTip(btUndo, "Click to <b>select</b> the base local path (your source directory)<br>for the current environment"); // start btStart.BackGrndImage = ImageResources.Deploy; tooltip.SetToolTip(btStart, "Click to <b>start</b> deploying your application"); btStart.ButtonPressed += BtStartOnButtonPressed; // Test btTest.BackGrndImage = ImageResources.Tests; tooltip.SetToolTip(btTest, "Click to <b>test</b> the deployment your application (this is safe)"); btTest.ButtonPressed += BtTestOnButtonPressed; // cancel btCancel.BackGrndImage = ImageResources.Cancel; tooltip.SetToolTip(btCancel, "Click to <b>cancel</b> the current deployement"); btCancel.ButtonPressed += BtCancelOnButtonPressed; btCancel.Visible = false; // progress bar progressBar.Style = ProgressStyle.Normal; progressBar.CenterText = CenterElement.Text; progressBar.Visible = false; // report btReport.BackGrndImage = ImageResources.Report; btReport.Visible = false; btReport.ButtonPressed += BtReportOnButtonPressed; lbl_report.Visible = false; lbl_report.LinkClicked += Utils.OpenPathClickHandler; // reset btReset.BackGrndImage = ImageResources.Default; tooltip.SetToolTip(btReset, "Click to reset the options to their default values"); btReset.ButtonPressed += (sender, args) => { ResetFields(); }; // help kink linkurl.Text = @"<img src='Help'><a href='" + Config.UrlHelpDeploy + @"'>Learn more about this feature?</a>"; // switch link lblCurEnv.LinkClicked += (sender, args) => { AppliMenu.ShowEnvMenu(true); }; // save tooltip.SetToolTip(btSave, "Save the settings for the currently selected profile"); btSave.BackGrndImage = ImageResources.Save; btSave.ButtonPressed += (sender, args) => { if (string.IsNullOrEmpty(DeploymentProfile.Current.Name) && !ChooseName()) { return; } SetDataFromFields(); SaveProfilesList(); }; // save as... tooltip.SetToolTip(btSaveAs, "Save the settings in a new profile that you will name"); btSaveAs.BackGrndImage = ImageResources.Save; btSaveAs.ButtonPressed += (sender, args) => { var cur = DeploymentProfile.Current; DeploymentProfile.List.Add(new DeploymentProfile()); DeploymentProfile.Current = DeploymentProfile.List.Last(); if (ChooseName()) { SetDataFromFields(); SaveProfilesList(); } else { DeploymentProfile.List.RemoveAt(DeploymentProfile.List.Count - 1); DeploymentProfile.Current = cur; } btDelete.Visible = DeploymentProfile.List.Count > 1; }; // delete tooltip.SetToolTip(btDelete, "Delete the current profile"); btDelete.BackGrndImage = ImageResources.Delete; btDelete.ButtonPressed += (sender, args) => { if (UserCommunication.Message("Do you really want to delete this profile?", MessageImg.MsgQuestion, "Delete", "Deployment profile", new List <string> { "Yes", "Cancel" }) == 0) { DeploymentProfile.List.Remove(DeploymentProfile.Current); DeploymentProfile.Current = null; SaveProfilesList(); SetFieldsFromData(); if (DeploymentProfile.List.Count == 1) { btDelete.Hide(); } } }; // cb tooltip.SetToolTip(cbName, "Browse and select the available profiles, each profile hold deployment settings"); cbName.SelectedIndexChangedByUser += CbNameOnSelectedIndexChanged; // modify rules tooltip.SetToolTip(btRules, "Click to modify the rules"); btRules.BackGrndImage = ImageResources.Rules; btRules.ButtonPressed += (sender, args) => DeploymentRules.EditRules(); // view rules tooltip.SetToolTip(btRules, "Click to view the rules filtered for the current environment<br><i>The rules are also sorted!</i>"); btSeeRules.BackGrndImage = ImageResources.ViewFile; btSeeRules.ButtonPressed += (sender, args) => { UserCommunication.Message(DeploymentRules.BuildHtmlTableForRules(ProEnvironment.Current.Deployer.DeployRules), MessageImg.MsgInfo, "List of deployment rules", "Sorted and filtered for the current environment"); }; DeploymentProfile.OnDeployProfilesUpdate += () => { UpdateCombo(); SetFieldsFromData(); btDelete.Visible = DeploymentProfile.List.Count > 1; }; // subscribe ProEnvironment.OnEnvironmentChange += OnShow; DeploymentRules.OnDeployConfigurationUpdate += OnShow; // dynamically reorder the controls for a correct tab order on notepad++ SetTabOrder.RemoveAndAddForTabOrder(scrollPanel); }