11
11
using System . Threading ;
12
12
using System . Windows . Forms ;
13
13
using DataWarehouseAutomation ;
14
+ using DataWarehouseAutomation . DwaModel ;
15
+ using DataWarehouseAutomation . Utils ;
14
16
using Newtonsoft . Json ;
15
17
using Newtonsoft . Json . Linq ;
16
18
using TEAM_Library ;
@@ -251,7 +253,6 @@ public void PopulateTemplateCollectionDataGrid()
251
253
}
252
254
}
253
255
254
- [ PermissionSet ( SecurityAction . Demand , Name = "FullTrust" ) ]
255
256
public void RunFileWatcher ( )
256
257
{
257
258
try
@@ -400,7 +401,6 @@ private void backgroundWorkerActivateMetadata_RunWorkerCompleted(object sender,
400
401
{
401
402
if ( e . Cancelled )
402
403
{
403
- // labelResult.Text = "Cancelled!";
404
404
richTextBoxInformationMain . AppendText ( "Cancelled!" ) ;
405
405
}
406
406
else if ( e . Error != null )
@@ -410,23 +410,7 @@ private void backgroundWorkerActivateMetadata_RunWorkerCompleted(object sender,
410
410
else
411
411
{
412
412
richTextBoxInformationMain . AppendText ( "Done. The metadata was processed succesfully!\r \n " ) ;
413
- //SetVersion(trackBarVersioning.Value);
414
413
}
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
430
414
}
431
415
432
416
# endregion
@@ -451,27 +435,27 @@ private void backgroundWorker_DoWorkMetadataActivation(object sender, DoWorkEven
451
435
private void saveConfigurationFileToolStripMenuItem_Click ( object sender , EventArgs e )
452
436
{
453
437
// Make sure the paths contain a backslash.
454
- if ( textBoxTeamEnvironmentsFilePath . Text . EndsWith ( @"\" ) )
438
+ if ( textBoxTeamEnvironmentsFilePath . Text . EndsWith ( ' \\ ' ) )
455
439
{
456
440
textBoxTeamEnvironmentsFilePath . Text = textBoxTeamEnvironmentsFilePath . Text . Replace ( @"\" , "" ) ;
457
441
}
458
442
459
- if ( ! textBoxTeamConfigurationPath . Text . EndsWith ( @"\" ) )
443
+ if ( ! textBoxTeamConfigurationPath . Text . EndsWith ( ' \\ ' ) )
460
444
{
461
445
textBoxTeamConfigurationPath . Text += @"\" ;
462
446
}
463
447
464
- if ( ! textBoxMetadataPath . Text . EndsWith ( @"\" ) )
448
+ if ( ! textBoxMetadataPath . Text . EndsWith ( ' \\ ' ) )
465
449
{
466
450
textBoxMetadataPath . Text += @"\" ;
467
451
}
468
452
469
- if ( ! textBoxOutputPath . Text . EndsWith ( @"\" ) )
453
+ if ( ! textBoxOutputPath . Text . EndsWith ( ' \\ ' ) )
470
454
{
471
455
textBoxOutputPath . Text += @"\" ;
472
456
}
473
457
474
- if ( ! textBoxTemplatePath . Text . EndsWith ( @"\" ) )
458
+ if ( ! textBoxTemplatePath . Text . EndsWith ( ' \\ ' ) )
475
459
{
476
460
textBoxTemplatePath . Text += @"\" ;
477
461
}
@@ -602,7 +586,7 @@ internal class LocalTemplate
602
586
{
603
587
internal string classification { get ; set ; }
604
588
internal string notes { get ; set ; }
605
- internal Dictionary < string , VDW_DataObjectMappingList > itemList { get ; set ; }
589
+ internal Dictionary < string , VdwDataObjectMappingList > itemList { get ; set ; }
606
590
}
607
591
608
592
@@ -621,7 +605,7 @@ internal List<LocalTemplate> GetMetadata()
621
605
#region Deserialisation
622
606
623
607
// 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 > ( ) ;
625
609
626
610
if ( Directory . Exists ( VdwConfigurationSettings . VdwMetadatPath ) )
627
611
{
@@ -673,7 +657,7 @@ internal List<LocalTemplate> GetMetadata()
673
657
674
658
// Add the file to the list of mappings.
675
659
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 ) ;
677
661
678
662
if ( deserialisedMapping != null )
679
663
{
@@ -712,11 +696,11 @@ internal List<LocalTemplate> GetMetadata()
712
696
713
697
// First step, re-ordering and flattening.
714
698
// 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 > > ( ) ;
716
700
717
701
if ( mappingList . Any ( ) )
718
702
{
719
- foreach ( VDW_DataObjectMappingList dataObjectMappings in mappingList )
703
+ foreach ( VdwDataObjectMappingList dataObjectMappings in mappingList )
720
704
{
721
705
if ( dataObjectMappings . DataObjectMappings != null )
722
706
{
@@ -782,7 +766,7 @@ internal List<LocalTemplate> GetMetadata()
782
766
foreach ( var classification in classificationDictionary )
783
767
{
784
768
LocalTemplate localTemplateMapping = new LocalTemplate ( ) ;
785
- Dictionary < string , VDW_DataObjectMappingList > itemList = new Dictionary < string , VDW_DataObjectMappingList > ( ) ;
769
+ Dictionary < string , VdwDataObjectMappingList > itemList = new Dictionary < string , VdwDataObjectMappingList > ( ) ;
786
770
787
771
foreach ( var objectRow in objectDictionary )
788
772
{
@@ -1038,7 +1022,7 @@ private void pictureBox4_Click(object sender, EventArgs e)
1038
1022
}
1039
1023
1040
1024
string finalPath ;
1041
- if ( fileBrowserDialog . SelectedPath . EndsWith ( @"\" ) )
1025
+ if ( fileBrowserDialog . SelectedPath . EndsWith ( ' \\ ' ) )
1042
1026
{
1043
1027
finalPath = fileBrowserDialog . SelectedPath ;
1044
1028
}
@@ -1080,7 +1064,7 @@ private void pictureBox5_Click(object sender, EventArgs e)
1080
1064
{
1081
1065
string finalPath ;
1082
1066
1083
- if ( fileBrowserDialog . SelectedPath . EndsWith ( @"\" ) )
1067
+ if ( fileBrowserDialog . SelectedPath . EndsWith ( ' \\ ' ) )
1084
1068
{
1085
1069
finalPath = fileBrowserDialog . SelectedPath ;
1086
1070
}
@@ -1145,7 +1129,7 @@ private void PictureBoxUpdateTemplatePath_Click(object sender, EventArgs e)
1145
1129
}
1146
1130
1147
1131
string finalPath ;
1148
- if ( fileBrowserDialog . SelectedPath . EndsWith ( @"\" ) )
1132
+ if ( fileBrowserDialog . SelectedPath . EndsWith ( ' \\ ' ) )
1149
1133
{
1150
1134
finalPath = fileBrowserDialog . SelectedPath ;
1151
1135
}
@@ -1412,7 +1396,7 @@ private void pictureOpenTeamConfigurationFile_Click(object sender, EventArgs e)
1412
1396
else
1413
1397
{
1414
1398
string finalPath ;
1415
- if ( fileBrowserDialog . SelectedPath . EndsWith ( @"\" ) )
1399
+ if ( fileBrowserDialog . SelectedPath . EndsWith ( ' \\ ' ) )
1416
1400
{
1417
1401
finalPath = fileBrowserDialog . SelectedPath ;
1418
1402
}
@@ -1520,7 +1504,7 @@ private void comboBoxEnvironments_SelectedIndexChanged(object sender, EventArgs
1520
1504
VdwConfigurationSettings . TemplatePath = VdwConfigurationSettings . ActiveEnvironment . templatePath ;
1521
1505
VdwConfigurationSettings . VdwOutputPath = VdwConfigurationSettings . ActiveEnvironment . outputPath ;
1522
1506
1523
- if ( startUpIndicator != true )
1507
+ if ( ! startUpIndicator )
1524
1508
{
1525
1509
// Reload the configuration and connections file associated with this new environment.
1526
1510
VdwUtility . LoadTeamConnectionsFileForVdw ( VdwConfigurationSettings . ActiveEnvironment . environmentKey , VdwConfigurationSettings . VdwEventLog ) ;
@@ -1529,7 +1513,6 @@ private void comboBoxEnvironments_SelectedIndexChanged(object sender, EventArgs
1529
1513
richTextBoxInformationMain . AppendText ( $ "The '{ VdwConfigurationSettings . ActiveEnvironment . environmentKey } ' environment is now active.\r \n ") ;
1530
1514
}
1531
1515
// Ensure the template overview is updated.
1532
- //_templateGridView = new TemplateGridView(TeamConfigurationSettings);
1533
1516
RefreshTemplateGrid ( ) ;
1534
1517
}
1535
1518
0 commit comments