Subversion Repositories Code-Repo

Compare Revisions

No changes between revisions

Ignore whitespace Rev 20 → Rev 21

/SWAT USB App/trunk/SWAT USB App/AboutBox.cs
15,7 → 15,7
InitializeComponent();
this.Text = "Program Info";
this.labelProductName.Text = "SWAT USB App";
this.labelVersion.Text = "Version 2.2";
this.labelVersion.Text = "Version 2.2.1";
this.labelCopyright.Text = "Copyright to Kevin Lee @ Virginia Tech";
this.labelCompanyName.Text = "Author: Kevin Lee";
this.textBoxDescription.Text = "This program has been written by Kevin Lee for use " +
/SWAT USB App/trunk/SWAT USB App/bin/Debug/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/bin/Debug/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/bin/Release/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/bin/Release/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/form_Software.cs
33,99 → 33,112
}
public form_Software()
{
this.Load += new EventHandler(form_Software_Load);
// Draws the form with a checkbox for each software specified in the text file
InitializeComponent();
}
void form_Software_Load(object sender, EventArgs e)
{
try
{
DebugText.appendText("Software form initializing");
// Draws the form with a checkbox for each software specified in the text file
InitializeComponent();
// Clears all lists
subGroups.Clear();
toInstall.Clear();
formCheckBoxes.Clear();
formRadioButton.Clear();
// Location placeholder
int nextXLocation = 6, nextYLocation = 19;
// Extracts all groups from ApplicationsList
for (int i = 0; i < SettingsParser.ApplicationsList.Count(); i++)
if (SettingsParser.ApplicationsList[i].Group != null)
{
// Check if group exists already
bool groupExist = false;
for (int j = 0; j < subGroups.Count(); j++)
if (SettingsParser.ApplicationsList[i].Group == subGroups[j])
{
groupExist = true;
break;
}
if (!groupExist)
subGroups.Add(SettingsParser.ApplicationsList[i].Group);
}
// Updates the groupbox size to hold all the checkboxes and subgroups
this.groupBox_SoftwareList.Size = new Size(SettingsParser.softwareFormWidth - 30, 19 + SettingsParser.ApplicationsList.Count() * 23 + (subGroups.Count() * 25));
// Updates the window size to hold all elements
this.Size = new Size(SettingsParser.softwareFormWidth, 101 + SettingsParser.ApplicationsList.Count() * 23 + (subGroups.Count() * 25));
// Adds a checkbox for each software item that is ungrouped, adds checkbox to list formCheckBoxes
for (int i = 0; i < SettingsParser.ApplicationsList.Count(); i++)
if (SettingsParser.ApplicationsList.Count() == 0)
{
if (SettingsParser.ApplicationsList[i].Group == null)
{
// Creates a new checkbox
CheckBox chkBox = new CheckBox();
chkBox.Name = "chk_" + SettingsParser.ApplicationsList[i].Name;
chkBox.AutoSize = true;
chkBox.Text = SettingsParser.ApplicationsList[i].Name;
if (SettingsParser.ApplicationsList[i].Default)
chkBox.Checked = true;
chkBox.Location = new Point(nextXLocation, nextYLocation);
// Increments the location placeholder for the next element
nextYLocation += 23;
// Adds the checkbox to the parent groupbox
this.groupBox_SoftwareList.Controls.Add(chkBox);
// Adds the checkbox to formCheckBoxes list
formCheckBoxes.Add(chkBox);
}
DebugText.appendText("No software were found in USBSettings.xml");
MessageBox.Show("No software were found in USBSettings.xml");
this.Close();
}
// Adds a groupbox for each entry specified in subGroups as well as any applications under the group
for (int i = 0; i < subGroups.Count(); i++)
else
{
// Sets the internal location coordinates for the next element
int subNextXLocation = 6;
int subNextYLocation = 19;
// Creates a new groupbox
GroupBox grpBox = new GroupBox();
grpBox.Name = "grp_" + subGroups[i];
grpBox.Text = subGroups[i];
// Finds the number of applications under the group
int numberOfSubentries = 0;
for (int j = 0; j < SettingsParser.ApplicationsList.Count(); j++)
if (SettingsParser.ApplicationsList[j].Group == subGroups[i])
DebugText.appendText("Software form initializing");
// Clears all lists
subGroups.Clear();
toInstall.Clear();
formCheckBoxes.Clear();
formRadioButton.Clear();
// Location placeholder
int nextXLocation = 6, nextYLocation = 19;
// Extracts all groups from ApplicationsList
for (int i = 0; i < SettingsParser.ApplicationsList.Count(); i++)
if (SettingsParser.ApplicationsList[i].Group != null)
{
// If the group matches, creates a new radiobutton
numberOfSubentries++;
RadioButton rdoBtn = new RadioButton();
rdoBtn.Name = "rdo_" + SettingsParser.ApplicationsList[j].Name;
rdoBtn.AutoSize = true;
rdoBtn.Text = SettingsParser.ApplicationsList[j].Name;
if (SettingsParser.ApplicationsList[j].Default)
rdoBtn.Checked = true;
rdoBtn.Location = new Point(subNextXLocation, subNextYLocation);
// Check if group exists already
bool groupExist = false;
for (int j = 0; j < subGroups.Count(); j++)
if (SettingsParser.ApplicationsList[i].Group == subGroups[j])
{
groupExist = true;
break;
}
if (!groupExist)
subGroups.Add(SettingsParser.ApplicationsList[i].Group);
}
// Updates the groupbox size to hold all the checkboxes and subgroups
this.groupBox_SoftwareList.Size = new Size(SettingsParser.softwareFormWidth - 30, 19 + SettingsParser.ApplicationsList.Count() * 23 + (subGroups.Count() * 25));
// Updates the window size to hold all elements
this.Size = new Size(SettingsParser.softwareFormWidth, 101 + SettingsParser.ApplicationsList.Count() * 23 + (subGroups.Count() * 25));
// Adds a checkbox for each software item that is ungrouped, adds checkbox to list formCheckBoxes
for (int i = 0; i < SettingsParser.ApplicationsList.Count(); i++)
{
if (SettingsParser.ApplicationsList[i].Group == null)
{
// Creates a new checkbox
CheckBox chkBox = new CheckBox();
chkBox.Name = "chk_" + SettingsParser.ApplicationsList[i].Name;
chkBox.AutoSize = true;
chkBox.Text = SettingsParser.ApplicationsList[i].Name;
if (SettingsParser.ApplicationsList[i].Default)
chkBox.Checked = true;
chkBox.Location = new Point(nextXLocation, nextYLocation);
// Increments the location placeholder for the next element
subNextYLocation += 23;
// Adds the radiobutton to the parent groupbox
grpBox.Controls.Add(rdoBtn);
// Adds the radiobutton to formRadioButton list
formRadioButton.Add(rdoBtn);
nextYLocation += 23;
// Adds the checkbox to the parent groupbox
this.groupBox_SoftwareList.Controls.Add(chkBox);
// Adds the checkbox to formCheckBoxes list
formCheckBoxes.Add(chkBox);
}
grpBox.Size = new Size(SettingsParser.softwareFormWidth - 42, 19 + numberOfSubentries * 23);
grpBox.Location = new Point(nextXLocation, nextYLocation);
nextYLocation += 25 + numberOfSubentries * 23;
// Adds the created groupbox to the parent groupbox
this.groupBox_SoftwareList.Controls.Add(grpBox);
}
// Adds a groupbox for each entry specified in subGroups as well as any applications under the group
for (int i = 0; i < subGroups.Count(); i++)
{
// Sets the internal location coordinates for the next element
int subNextXLocation = 6;
int subNextYLocation = 19;
// Creates a new groupbox
GroupBox grpBox = new GroupBox();
grpBox.Name = "grp_" + subGroups[i];
grpBox.Text = subGroups[i];
// Finds the number of applications under the group
int numberOfSubentries = 0;
for (int j = 0; j < SettingsParser.ApplicationsList.Count(); j++)
if (SettingsParser.ApplicationsList[j].Group == subGroups[i])
{
// If the group matches, creates a new radiobutton
numberOfSubentries++;
RadioButton rdoBtn = new RadioButton();
rdoBtn.Name = "rdo_" + SettingsParser.ApplicationsList[j].Name;
rdoBtn.AutoSize = true;
rdoBtn.Text = SettingsParser.ApplicationsList[j].Name;
if (SettingsParser.ApplicationsList[j].Default)
rdoBtn.Checked = true;
rdoBtn.Location = new Point(subNextXLocation, subNextYLocation);
// Increments the location placeholder for the next element
subNextYLocation += 23;
// Adds the radiobutton to the parent groupbox
grpBox.Controls.Add(rdoBtn);
// Adds the radiobutton to formRadioButton list
formRadioButton.Add(rdoBtn);
}
grpBox.Size = new Size(SettingsParser.softwareFormWidth - 42, 19 + numberOfSubentries * 23);
grpBox.Location = new Point(nextXLocation, nextYLocation);
nextYLocation += 25 + numberOfSubentries * 23;
// Adds the created groupbox to the parent groupbox
this.groupBox_SoftwareList.Controls.Add(grpBox);
}
}
}
catch (Exception e)
catch (Exception ex)
{
DebugText.appendText("Exception Thrown: " + e.ToString());
DebugText.appendText("Exception Thrown: " + ex.ToString());
MessageBox.Show(e.ToString());
}
}
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Debug/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT USB App.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App/obj/x86/Release/SWAT USB App.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/SWAT USB App/trunk/SWAT USB App.suo
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream