//------------------------------------------------------------- // ConfirmForm Constructor //------------------------------------------------------------- public ConfirmForm(PathsForm parent) { InitializeComponent(); this.myParent = parent; this.txtBoxISOpath.Text = this.getParent().getISOpath(); // Set file or image path in text box this.isoID = Path.GetFileNameWithoutExtension(this.txtBoxISOpath.Text); // isoID Example: 30000038669341 // installScriptPath Example: \\afs\iu.edu\public\sudoc\volumes\04\30000038669341\30000038669341_install.exe this.installScriptPath = Path.Combine(Path.GetDirectoryName(this.txtBoxISOpath.Text), this.isoID + "_install.exe"); if (this.myParent.getParent().getServiceProvider() == 1) { this.txtBoxProvider.Text = "Workstation"; } else { this.txtBoxProvider.Text = "Server Console"; } // Check to see if there is a help file. // If there is a button is added to the form so the user can view the help file. if (File.Exists(Path.Combine(Path.GetDirectoryName(installScriptPath), "index.html"))) { this.btnHelp.Visible = true; this.lblHelp.Visible = true; } }
//------------------------------------------------------------- // ConfirmForm Constructor //------------------------------------------------------------- public ConfirmForm(PathsForm parent) { InitializeComponent(); this.myParent = parent; this.txtBoxISOpath.Text = this.getParent().getISOpath(); // Set file or image path in text box this.isoID = Path.GetFileNameWithoutExtension(this.txtBoxISOpath.Text); // isoID Example: 30000038669341 // installScriptPath Example: \\afs\iu.edu\public\sudoc\volumes\04\30000038669341\30000038669341_install.exe this.installScriptPath = Path.Combine(Path.GetDirectoryName(this.txtBoxISOpath.Text), this.isoID + "_install.exe"); if(this.myParent.getParent().getServiceProvider() == 1) { this.txtBoxProvider.Text = "Workstation"; } else { this.txtBoxProvider.Text = "Server Console"; } // Check to see if there is a help file. // If there is a button is added to the form so the user can view the help file. if(File.Exists(Path.Combine(Path.GetDirectoryName(installScriptPath), "index.html"))) { this.btnHelp.Visible = true; this.lblHelp.Visible = true; } }
//------------------------------------------------------------- // Next button event. //------------------------------------------------------------- private void btnNext_Click(object sender, EventArgs e) { /* If pathsForm == null, it has not been initiated yet so create one. The purpose of * doing it this way (instead of just making one and showing it) is for going back * and forth between forms. * * SCENARIO: A user clicks Next and procedes to pathsForm, they enter their .VMX and * .ISO files but then realize they chose the wrong service provider so they click * on "Previous". Now when they click "Next" again, their information will still be * there and they will not have to re-enter it. :) YAY! */ if (this.pathsForm == null) { this.Visible = false; this.pathsForm = new PathsForm(this, this.webPath); this.pathsForm.ShowDialog(); } else { this.Visible = false; this.pathsForm.ShowDialog(); } }
//------------------------------------------------------------- // Next button event. //------------------------------------------------------------- private void btnNext_Click(object sender, EventArgs e) { /* If pathsForm == null, it has not been initiated yet so create one. The purpose of * doing it this way (instead of just making one and showing it) is for going back * and forth between forms. * * SCENARIO: A user clicks Next and procedes to pathsForm, they enter their .VMX and * .ISO files but then realize they chose the wrong service provider so they click * on "Previous". Now when they click "Next" again, their information will still be * there and they will not have to re-enter it. :) YAY! */ if(this.pathsForm == null) { this.Visible = false; this.pathsForm = new PathsForm(this, this.webPath); this.pathsForm.ShowDialog(); } else { this.Visible = false; this.pathsForm.ShowDialog(); } }