Skip to content

Commit

Permalink
Implement issue 802 (#815)
Browse files Browse the repository at this point in the history
* ISSUE 802

* Update src/ServiceBusExplorer/Forms/MainForm.cs

Co-authored-by: Sean Feldman <[email protected]>

* Update MainForm.cs

---------

Co-authored-by: Sean Feldman <[email protected]>
  • Loading branch information
NaorisKong and SeanFeldman authored Dec 4, 2024
1 parent f81be16 commit d42b13b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ServiceBusExplorer/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1817,6 +1817,7 @@ private void RefreshIndividualSubscription(SubscriptionDescription subscriptionD
private void RefreshIndividualTopic(TreeNode selectedNode)
{
var wasTopicNodeExpanded = selectedNode.IsExpanded;
var wasSubscriptionsNodeExpanded = false;

var topicDescription = selectedNode.Tag as TopicDescription;

Expand All @@ -1829,6 +1830,13 @@ private void RefreshIndividualTopic(TreeNode selectedNode)
return;
}

//record the original subscriptions node is expanded
var originalSubscriptionsNode = selectedNode.Nodes.Find(SubscriptionEntities, false).FirstOrDefault();
if (originalSubscriptionsNode != null)
{
wasSubscriptionsNodeExpanded = originalSubscriptionsNode.IsExpanded;
}

selectedNode.Nodes.Clear();
var subscriptionsNode = selectedNode.Nodes.Add(SubscriptionEntities, SubscriptionEntities, SubscriptionListIconIndex, SubscriptionListIconIndex);
subscriptionsNode.Text = string.IsNullOrWhiteSpace(FilterExpressionHelper.SubscriptionFilterExpression) ? SubscriptionEntities : FilteredSubscriptionEntities;
Expand All @@ -1852,6 +1860,10 @@ private void RefreshIndividualTopic(TreeNode selectedNode)

if (wasTopicNodeExpanded)
selectedNode.Expand();
if (wasSubscriptionsNodeExpanded == true)
{
subscriptionsNode.Expand();
}
}

private void createEntity_Click(object sender, EventArgs e)
Expand Down

0 comments on commit d42b13b

Please sign in to comment.