Skip to content

Commit 6f42c25

Browse files
committed
Tidy-ups
1 parent 11b992d commit 6f42c25

File tree

5 files changed

+33
-52
lines changed

5 files changed

+33
-52
lines changed

Virtual_EDW/CustomTabPage.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Newtonsoft.Json;
1212
using DataWarehouseAutomation;
1313
using TEAM_Library;
14+
using DataWarehouseAutomation.Utils;
1415

1516
namespace Virtual_Data_Warehouse
1617
{
@@ -39,7 +40,7 @@ public MyClearArgs()
3940
class CustomTabPage : TabPage
4041
{
4142
readonly string _inputNiceName;
42-
internal Dictionary<string, VDW_DataObjectMappingList> ItemList;
43+
internal Dictionary<string, VdwDataObjectMappingList> ItemList;
4344

4445
// Objects on main Tab Page
4546
readonly CheckBox _localCheckBoxSelectAll;
@@ -103,7 +104,7 @@ public void SetSaveOutputFileFlag(bool value)
103104
/// <summary>
104105
/// Constructor to instantiate a new Custom Tab Page
105106
/// </summary>
106-
public CustomTabPage(string classification, string notes, Dictionary<string, VDW_DataObjectMappingList> itemList)
107+
public CustomTabPage(string classification, string notes, Dictionary<string, VdwDataObjectMappingList> itemList)
107108
{
108109
// Register the Handlebars helpers (extensions), these are maintained in the DataWarehouseAutomation class library.
109110
HandleBarsHelpers.RegisterHandleBarsHelpers();
@@ -425,7 +426,7 @@ public void FilterItemList(object o, EventArgs e)
425426
SetItemList(ItemList);
426427
}
427428

428-
public void SetItemList(Dictionary<string, VDW_DataObjectMappingList> itemList)
429+
public void SetItemList(Dictionary<string, VdwDataObjectMappingList> itemList)
429430
{
430431
// Copy the input variable to the local item list.
431432
this.ItemList = itemList;

Virtual_EDW/Form_Main.Designer.cs

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Virtual_EDW/Form_Main.cs

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
using System.Threading;
1212
using System.Windows.Forms;
1313
using DataWarehouseAutomation;
14+
using DataWarehouseAutomation.DwaModel;
15+
using DataWarehouseAutomation.Utils;
1416
using Newtonsoft.Json;
1517
using Newtonsoft.Json.Linq;
1618
using TEAM_Library;
@@ -251,7 +253,6 @@ public void PopulateTemplateCollectionDataGrid()
251253
}
252254
}
253255

254-
[PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
255256
public void RunFileWatcher()
256257
{
257258
try
@@ -400,7 +401,6 @@ private void backgroundWorkerActivateMetadata_RunWorkerCompleted(object sender,
400401
{
401402
if (e.Cancelled)
402403
{
403-
// labelResult.Text = "Cancelled!";
404404
richTextBoxInformationMain.AppendText("Cancelled!");
405405
}
406406
else if (e.Error != null)
@@ -410,23 +410,7 @@ private void backgroundWorkerActivateMetadata_RunWorkerCompleted(object sender,
410410
else
411411
{
412412
richTextBoxInformationMain.AppendText("Done. The metadata was processed succesfully!\r\n");
413-
//SetVersion(trackBarVersioning.Value);
414413
}
415-
416-
// Close the AlertForm
417-
//alert.Close();
418-
}
419-
420-
// This event handler updates the progress.
421-
private void backgroundWorkerActivateMetadata_ProgressChanged(object sender, ProgressChangedEventArgs e)
422-
{
423-
// Show the progress in main form (GUI)
424-
//labelResult.Text = (e.ProgressPercentage + "%");
425-
426-
// Pass the progress to AlertForm label and progressbar
427-
428-
429-
// Manage the logging
430414
}
431415

432416
# endregion
@@ -451,27 +435,27 @@ private void backgroundWorker_DoWorkMetadataActivation(object sender, DoWorkEven
451435
private void saveConfigurationFileToolStripMenuItem_Click(object sender, EventArgs e)
452436
{
453437
// Make sure the paths contain a backslash.
454-
if (textBoxTeamEnvironmentsFilePath.Text.EndsWith(@"\"))
438+
if (textBoxTeamEnvironmentsFilePath.Text.EndsWith('\\'))
455439
{
456440
textBoxTeamEnvironmentsFilePath.Text = textBoxTeamEnvironmentsFilePath.Text.Replace(@"\", "");
457441
}
458442

459-
if (!textBoxTeamConfigurationPath.Text.EndsWith(@"\"))
443+
if (!textBoxTeamConfigurationPath.Text.EndsWith('\\'))
460444
{
461445
textBoxTeamConfigurationPath.Text += @"\";
462446
}
463447

464-
if (!textBoxMetadataPath.Text.EndsWith(@"\"))
448+
if (!textBoxMetadataPath.Text.EndsWith('\\'))
465449
{
466450
textBoxMetadataPath.Text += @"\";
467451
}
468452

469-
if (!textBoxOutputPath.Text.EndsWith(@"\"))
453+
if (!textBoxOutputPath.Text.EndsWith('\\'))
470454
{
471455
textBoxOutputPath.Text += @"\";
472456
}
473457

474-
if (!textBoxTemplatePath.Text.EndsWith(@"\"))
458+
if (!textBoxTemplatePath.Text.EndsWith('\\'))
475459
{
476460
textBoxTemplatePath.Text += @"\";
477461
}
@@ -602,7 +586,7 @@ internal class LocalTemplate
602586
{
603587
internal string classification { get; set; }
604588
internal string notes { get; set; }
605-
internal Dictionary<string, VDW_DataObjectMappingList> itemList { get; set; }
589+
internal Dictionary<string, VdwDataObjectMappingList> itemList { get; set; }
606590
}
607591

608592

@@ -621,7 +605,7 @@ internal List<LocalTemplate> GetMetadata()
621605
#region Deserialisation
622606

623607
// Deserialise the Json files into a local List of Data Object Mappings (mappingList) for further use.
624-
List<VDW_DataObjectMappingList> mappingList = new List<VDW_DataObjectMappingList>();
608+
List<VdwDataObjectMappingList> mappingList = new List<VdwDataObjectMappingList>();
625609

626610
if (Directory.Exists(VdwConfigurationSettings.VdwMetadatPath))
627611
{
@@ -673,7 +657,7 @@ internal List<LocalTemplate> GetMetadata()
673657

674658
// Add the file to the list of mappings.
675659
var jsonInput = File.ReadAllText(fileName);
676-
VDW_DataObjectMappingList deserialisedMapping = System.Text.Json.JsonSerializer.Deserialize<VDW_DataObjectMappingList>(jsonInput);
660+
VdwDataObjectMappingList deserialisedMapping = System.Text.Json.JsonSerializer.Deserialize<VdwDataObjectMappingList>(jsonInput);
677661

678662
if (deserialisedMapping != null)
679663
{
@@ -712,11 +696,11 @@ internal List<LocalTemplate> GetMetadata()
712696

713697
// First step, re-ordering and flattening.
714698
// In the Tuple, Item1 is the classification, Item2 is the mapping name and Item 3 is notes.
715-
Dictionary<VDW_DataObjectMappingList, Tuple<string, string, string>> objectDictionary = new Dictionary<VDW_DataObjectMappingList, Tuple<string, string, string>>();
699+
Dictionary<VdwDataObjectMappingList, Tuple<string, string, string>> objectDictionary = new Dictionary<VdwDataObjectMappingList, Tuple<string, string, string>>();
716700

717701
if (mappingList.Any())
718702
{
719-
foreach (VDW_DataObjectMappingList dataObjectMappings in mappingList)
703+
foreach (VdwDataObjectMappingList dataObjectMappings in mappingList)
720704
{
721705
if (dataObjectMappings.DataObjectMappings != null)
722706
{
@@ -782,7 +766,7 @@ internal List<LocalTemplate> GetMetadata()
782766
foreach (var classification in classificationDictionary)
783767
{
784768
LocalTemplate localTemplateMapping = new LocalTemplate();
785-
Dictionary<string, VDW_DataObjectMappingList> itemList = new Dictionary<string, VDW_DataObjectMappingList>();
769+
Dictionary<string, VdwDataObjectMappingList> itemList = new Dictionary<string, VdwDataObjectMappingList>();
786770

787771
foreach (var objectRow in objectDictionary)
788772
{
@@ -1038,7 +1022,7 @@ private void pictureBox4_Click(object sender, EventArgs e)
10381022
}
10391023

10401024
string finalPath;
1041-
if (fileBrowserDialog.SelectedPath.EndsWith(@"\"))
1025+
if (fileBrowserDialog.SelectedPath.EndsWith('\\'))
10421026
{
10431027
finalPath = fileBrowserDialog.SelectedPath;
10441028
}
@@ -1080,7 +1064,7 @@ private void pictureBox5_Click(object sender, EventArgs e)
10801064
{
10811065
string finalPath;
10821066

1083-
if (fileBrowserDialog.SelectedPath.EndsWith(@"\"))
1067+
if (fileBrowserDialog.SelectedPath.EndsWith('\\'))
10841068
{
10851069
finalPath = fileBrowserDialog.SelectedPath;
10861070
}
@@ -1145,7 +1129,7 @@ private void PictureBoxUpdateTemplatePath_Click(object sender, EventArgs e)
11451129
}
11461130

11471131
string finalPath;
1148-
if (fileBrowserDialog.SelectedPath.EndsWith(@"\"))
1132+
if (fileBrowserDialog.SelectedPath.EndsWith('\\'))
11491133
{
11501134
finalPath = fileBrowserDialog.SelectedPath;
11511135
}
@@ -1412,7 +1396,7 @@ private void pictureOpenTeamConfigurationFile_Click(object sender, EventArgs e)
14121396
else
14131397
{
14141398
string finalPath;
1415-
if (fileBrowserDialog.SelectedPath.EndsWith(@"\"))
1399+
if (fileBrowserDialog.SelectedPath.EndsWith('\\'))
14161400
{
14171401
finalPath = fileBrowserDialog.SelectedPath;
14181402
}
@@ -1520,7 +1504,7 @@ private void comboBoxEnvironments_SelectedIndexChanged(object sender, EventArgs
15201504
VdwConfigurationSettings.TemplatePath = VdwConfigurationSettings.ActiveEnvironment.templatePath;
15211505
VdwConfigurationSettings.VdwOutputPath = VdwConfigurationSettings.ActiveEnvironment.outputPath;
15221506

1523-
if (startUpIndicator != true)
1507+
if (!startUpIndicator)
15241508
{
15251509
// Reload the configuration and connections file associated with this new environment.
15261510
VdwUtility.LoadTeamConnectionsFileForVdw(VdwConfigurationSettings.ActiveEnvironment.environmentKey, VdwConfigurationSettings.VdwEventLog);
@@ -1529,7 +1513,6 @@ private void comboBoxEnvironments_SelectedIndexChanged(object sender, EventArgs
15291513
richTextBoxInformationMain.AppendText($"The '{VdwConfigurationSettings.ActiveEnvironment.environmentKey}' environment is now active.\r\n");
15301514
}
15311515
// Ensure the template overview is updated.
1532-
//_templateGridView = new TemplateGridView(TeamConfigurationSettings);
15331516
RefreshTemplateGrid();
15341517
}
15351518

Virtual_EDW/InterfaceObjectModel.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
using System;
22
using DataWarehouseAutomation;
3+
using DataWarehouseAutomation.DwaModel;
34

45
namespace Virtual_Data_Warehouse
56
{
67
/// <summary>
78
/// The parent object containing the list of source-to-target mappings. This is the highest level and contains the list of mappings (as individual objects
89
/// but also the parameters inherited from TEAM and VDW.
910
/// </summary>
10-
class VDW_DataObjectMappingList : DataObjectMappingList
11+
class VdwDataObjectMappingList : DataObjectMappingList
1112
{
12-
// Generic interface definitions
13-
//public List<DataObjectMapping> dataObjectMapping { get; set; }
14-
1513
// TEAM and VDW specific details
1614
public MetadataConfiguration conventions { get; set; }
17-
//public GenerationSpecificMetadata generationSpecificMetadata { get; set; }
15+
1816
public string metadataFileName { get; set; }
1917
}
2018

Virtual_EDW/Virtual_Data_Warehouse.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0-windows</TargetFramework>
3+
<TargetFramework>net8.0-windows7.0</TargetFramework>
44
<OutputType>WinExe</OutputType>
55
<IsWebBootstrapper>false</IsWebBootstrapper>
66
<SccProjectName>SAK</SccProjectName>
@@ -590,27 +590,27 @@
590590
</ItemGroup>
591591
<ItemGroup>
592592
<PackageReference Include="DataWarehouseAutomation">
593-
<Version>2.0.1</Version>
593+
<Version>2.0.3</Version>
594594
</PackageReference>
595595
<PackageReference Include="Handlebars.Net">
596-
<Version>2.1.4</Version>
596+
<Version>2.1.6</Version>
597597
</PackageReference>
598598
<PackageReference Include="Microsoft.Data.SqlClient">
599-
<Version>5.1.2</Version>
599+
<Version>5.2.0</Version>
600600
</PackageReference>
601601
<PackageReference Include="Microsoft.Identity.Client">
602-
<Version>4.59.1</Version>
602+
<Version>4.60.3</Version>
603603
</PackageReference>
604604
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects">
605-
<Version>170.18.0</Version>
605+
<Version>171.30.0</Version>
606606
</PackageReference>
607607
<PackageReference Include="Newtonsoft.Json">
608608
<Version>13.0.3</Version>
609609
</PackageReference>
610610
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.4.421302">
611611
<PrivateAssets>all</PrivateAssets>
612612
</PackageReference>
613-
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.5" />
614-
<PackageReference Include="Snowflake.Data" Version="2.1.2" />
613+
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.4" />
614+
<PackageReference Include="Snowflake.Data" Version="3.1.0" />
615615
</ItemGroup>
616616
</Project>

0 commit comments

Comments
 (0)