Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joao4all committed Jul 19, 2024
1 parent e771c1d commit aed8bc2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions COMETwebapp/ViewModels/Pages/TabsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public TabsViewModel(ISessionService sessionService, IServiceProvider servicePro
this.sessionService = sessionService;
this.serviceProvider = serviceProvider;
this.Disposables.Add(this.WhenAnyValue(x => x.SelectedApplication).Subscribe(_ => this.OnSelectedApplicationChange()));
this.Disposables.Add(this.WhenAnyValue(x => x.CurrentTab).Subscribe(_ => this.OnSelectedApplicationChange()));
this.Disposables.Add(this.sessionService.OpenIterations.CountChanged.Subscribe(this.CloseTabIfIterationClosed));
this.Disposables.Add(this.OpenTabs.Connect().WhereReasonsAre(ListChangeReason.Remove, ListChangeReason.RemoveRange).Subscribe(this.OnOpenTabRemoved));
}
Expand Down Expand Up @@ -170,6 +171,19 @@ private void OnSelectedApplicationChange()
this.CurrentTab = this.OpenTabs.Items.FirstOrDefault(x => x.ComponentType == this.SelectedApplication.ComponentType && x.Panel == null);
}

/// <summary>
/// Method executed everytime the <see cref="CurrentTab" /> changes
/// </summary>
private void OnCurrentTabChange()

Check warning on line 177 in COMETwebapp/ViewModels/Pages/TabsViewModel.cs

View workflow job for this annotation

GitHub Actions / Build

Remove the unused private method 'OnCurrentTabChange'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
{
if (this.CurrentTab == null)
{
return;
}

this.SelectedApplication = Applications.ExistingApplications.OfType<TabbedApplication>().First(x => x.ComponentType == this.CurrentTab.ComponentType);
}

/// <summary>
/// Closes a tab if its iteration has been closed
/// </summary>
Expand Down

0 comments on commit aed8bc2

Please sign in to comment.