Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement issue 802 #815

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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