Skip to content

Commit 928c440

Browse files
committed
Update Form_Main.cs
1 parent 5575ed4 commit 928c440

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

Virtual_EDW/Form_Main.cs

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public FormMain()
4141
VdwConfigurationSettings.VdwEventLog.Add(Event.CreateNewEvent(EventTypes.Information, $"{Text}."));
4242

4343
#region Root Paths
44-
// Make sure the root directories exist, based on (tool) parameters
44+
// Make sure the root directories exist, based on (tool) parameters.
4545

4646
// Configuration Path
4747
var localEvent = FileHandling.InitialisePath(GlobalParameters.VdwConfigurationPath);
@@ -51,23 +51,23 @@ public FormMain()
5151
}
5252
VdwConfigurationSettings.VdwEventLog.Add(Event.CreateNewEvent(EventTypes.Information, $"Configuration path initialised for {GlobalParameters.VdwConfigurationPath}."));
5353

54-
// Input Path
54+
// Input Path.
5555
localEvent = FileHandling.InitialisePath(VdwConfigurationSettings.VdwInputPath);
5656
if (localEvent.eventDescription != null)
5757
{
5858
VdwConfigurationSettings.VdwEventLog.Add(localEvent);
5959
}
6060
VdwConfigurationSettings.VdwEventLog.Add(Event.CreateNewEvent(EventTypes.Information, $"Input path set for {VdwConfigurationSettings.VdwInputPath}."));
6161

62-
// Output Path
62+
// Output Path.
6363
localEvent = FileHandling.InitialisePath(VdwConfigurationSettings.VdwOutputPath);
6464
if (localEvent.eventDescription != null)
6565
{
6666
VdwConfigurationSettings.VdwEventLog.Add(localEvent);
6767
}
6868
VdwConfigurationSettings.VdwEventLog.Add(Event.CreateNewEvent(EventTypes.Information, $"Output path set for {VdwConfigurationSettings.VdwOutputPath}."));
6969

70-
// Examples Path
70+
// Examples Path.
7171
localEvent = FileHandling.InitialisePath(VdwConfigurationSettings.VdwExamplesPath);
7272
if (localEvent.eventDescription != null)
7373
{
@@ -96,8 +96,7 @@ public FormMain()
9696
// The TeamEnvironmentCollection contains all the environments as specified in TEAM (environments file).
9797
try
9898
{
99-
TeamEnvironmentCollection.LoadTeamEnvironmentCollection(
100-
VdwConfigurationSettings.TeamEnvironmentFilePath);
99+
TeamEnvironmentCollection.LoadTeamEnvironmentCollection(VdwConfigurationSettings.TeamEnvironmentFilePath);
101100
}
102101
catch
103102
{
@@ -486,22 +485,22 @@ private void saveConfigurationFileToolStripMenuItem_Click(object sender, EventAr
486485

487486
if (!textBoxTeamConfigurationPath.Text.EndsWith(@"\"))
488487
{
489-
textBoxTeamConfigurationPath.Text = textBoxTeamConfigurationPath.Text + @"\";
488+
textBoxTeamConfigurationPath.Text += @"\";
490489
}
491490

492491
if (!textBoxInputPath.Text.EndsWith(@"\"))
493492
{
494-
textBoxInputPath.Text = textBoxInputPath.Text + @"\";
493+
textBoxInputPath.Text += @"\";
495494
}
496495

497496
if (!textBoxOutputPath.Text.EndsWith(@"\"))
498497
{
499-
textBoxOutputPath.Text = textBoxOutputPath.Text + @"\";
498+
textBoxOutputPath.Text += @"\";
500499
}
501500

502501
if (!textBoxLoadPatternPath.Text.EndsWith(@"\"))
503502
{
504-
textBoxLoadPatternPath.Text = textBoxLoadPatternPath.Text + @"\";
503+
textBoxLoadPatternPath.Text += @"\";
505504
}
506505

507506
new KeyValuePair< string, TeamWorkingEnvironment > ("", null);
@@ -563,7 +562,7 @@ private void openTEAMConfigurationSettingsFileToolStripMenuItem_Click(object sen
563562
}
564563
catch (Exception ex)
565564
{
566-
richTextBoxInformationMain.Text = "An error has occured while attempting to open the TEAM configuration file. The error message is: " + ex.Message;
565+
richTextBoxInformationMain.Text = "An error has occurred while attempting to open the TEAM configuration file. The error message is: " + ex.Message;
567566
}
568567
}
569568

@@ -663,6 +662,10 @@ internal List<LocalPattern> GetMetadata()
663662
"interfaceSourceLinkAttributeXref.json",
664663
"Development_TEAM_Model_Metadata.json",
665664
"Development_TEAM_Attribute_Mapping.json",
665+
"Development_TEAM_Table_Mapping.json",
666+
"Production_TEAM_Model_Metadata.json",
667+
"Production_TEAM_Attribute_Mapping.json",
668+
"Production_TEAM_Table_Mapping.json"
666669
};
667670

668671
if (fileEntries.Length > 0)
@@ -689,13 +692,16 @@ internal List<LocalPattern> GetMetadata()
689692
}
690693

691694
// Add the deserialised file to the list of mappings.
692-
VDW_DataObjectMappingList deserialisedMapping = new VDW_DataObjectMappingList();
695+
VDW_DataObjectMappingList deserialisedMapping;
693696

694697
var jsonInput = File.ReadAllText(fileName);
695698
deserialisedMapping = JsonConvert.DeserializeObject<VDW_DataObjectMappingList>(jsonInput);
696-
deserialisedMapping.metadataFileName = fileName;
699+
if (deserialisedMapping != null)
700+
{
701+
deserialisedMapping.metadataFileName = fileName;
697702

698-
mappingList.Add(deserialisedMapping);
703+
mappingList.Add(deserialisedMapping);
704+
}
699705
}
700706
catch (Exception exception)
701707
{
@@ -731,7 +737,7 @@ internal List<LocalPattern> GetMetadata()
731737
Dictionary<VDW_DataObjectMappingList, Tuple<string, string, string>> objectDictionary =
732738
new Dictionary<VDW_DataObjectMappingList, Tuple<string, string, string>>();
733739

734-
if (mappingList.Any() == true)
740+
if (mappingList.Any())
735741
{
736742
foreach (VDW_DataObjectMappingList dataObjectMappings in mappingList)
737743
{
@@ -1155,7 +1161,7 @@ private void pictureBoxUpdateLoadPatternPath_Click(object sender, EventArgs e)
11551161

11561162

11571163
// Update the parameters in memory.
1158-
VdwConfigurationSettings.LoadPatternPath = finalPath; ;
1164+
VdwConfigurationSettings.LoadPatternPath = finalPath;
11591165
textBoxLoadPatternPath.Text = finalPath;
11601166

11611167
// Report back to the user.

0 commit comments

Comments
 (0)