@@ -9,9 +9,17 @@ namespace DBADashGUI
99{
1010 public class DBADashContext : ICloneable
1111 {
12- public HashSet < int > InstanceIDs ;
13- public HashSet < int > AzureInstanceIDs ;
14- public HashSet < int > RegularInstanceIDs ;
12+ public HashSet < int > InstanceIDs => new HashSet < int > ( RegularInstanceIDs . Union ( AzureInstanceIDs ) ) ;
13+ public HashSet < int > AzureInstanceIDs => ShowHiddenInstances ? AzureInstanceIDsWithHidden : new HashSet < int > ( AzureInstanceIDsWithHidden . Except ( HiddenInstanceIDs ) ) ;
14+ public HashSet < int > RegularInstanceIDs => ShowHiddenInstances ? RegularInstanceIDsWithHidden : new HashSet < int > ( RegularInstanceIDsWithHidden . Except ( HiddenInstanceIDs ) ) ;
15+
16+ public bool ShowHiddenInstances => Common . ShowHidden || InstanceID > 0 ;
17+
18+ public HashSet < int > RegularInstanceIDsWithHidden = new ( ) ;
19+ public HashSet < int > AzureInstanceIDsWithHidden = new ( ) ;
20+
21+ public static HashSet < int > HiddenInstanceIDs = new ( ) ;
22+
1523 public string InstanceName { get ; set ; }
1624 public string DatabaseName { get ; set ; }
1725 public int InstanceID { get ; set ; }
@@ -41,7 +49,7 @@ public Version ProductVersion
4149 {
4250 get
4351 {
44- if ( _productVersion != null ) return _productVersion ;
52+ if ( _productVersion != null ) return _productVersion ;
4553 GetAdditionalInfo ( ) ;
4654 return _productVersion ;
4755 }
@@ -51,7 +59,7 @@ public int? ImportAgentID
5159 {
5260 get
5361 {
54- if ( _importAgentID != null || InstanceID <= 0 ) return _importAgentID ;
62+ if ( _importAgentID != null || InstanceID <= 0 ) return _importAgentID ;
5563 GetAdditionalInfo ( ) ;
5664 return _importAgentID ;
5765 }
@@ -61,7 +69,7 @@ public int? CollectAgentID
6169 {
6270 get
6371 {
64- if ( _collectAgentID != null || InstanceID <= 0 ) return _collectAgentID ;
72+ if ( _collectAgentID != null || InstanceID <= 0 ) return _collectAgentID ;
6573 GetAdditionalInfo ( ) ;
6674 return _collectAgentID ;
6775 }
@@ -71,7 +79,7 @@ public string ConnectionID
7179 {
7280 get
7381 {
74- if ( _connectionID != null ) return _connectionID ;
82+ if ( _connectionID != null ) return _connectionID ;
7583 GetAdditionalInfo ( ) ;
7684 return _connectionID ;
7785 }
@@ -81,8 +89,8 @@ public string ConnectionID
8189
8290 private void GetAdditionalInfo ( )
8391 {
84- if ( InstanceID <= 0 ) return ;
85- var row = CommonData . Instances . Select ( $ "InstanceID={ InstanceID } ") . FirstOrDefault ( ) ;
92+ if ( InstanceID <= 0 ) return ;
93+ var row = CommonData . Instances . Select ( $ "InstanceID={ InstanceID } ") . FirstOrDefault ( ) ;
8694 if ( row == null ) return ;
8795 _collectAgentID = ( int ) row [ "CollectAgentID" ] ;
8896 _importAgentID = ( int ) row [ "ImportAgentID" ] ;
0 commit comments