Skip to content

Commit 4c61b2c

Browse files
committed
update auf .net 9, Bugfix für "single user bug"
1 parent 20f1429 commit 4c61b2c

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

Source/VisualPairCoding/VisualPairCoding.AvaloniaUI/EnterNamesWindow.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public EnterNamesForm(bool autostart, string configPath)
3434
}
3535
}
3636

37-
private MenuItem GetRecentMenuItem()
37+
private MenuItem? GetRecentMenuItem()
3838
{
3939
return this.FindControl<MenuItem>("recentMenuItem");
4040
}

Source/VisualPairCoding/VisualPairCoding.AvaloniaUI/RunSessionForm.axaml.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ private async void Timer_Tick(object? sender, EventArgs e)
129129

130130
private async void ChooseAnotherPairAndStartNewTurn()
131131
{
132-
133132
timer.Stop();
134133

135134
_currentTime = new TimeSpan(0, _pairCodingSession.MinutesPerTurn, 0);
@@ -140,7 +139,11 @@ private async void ChooseAnotherPairAndStartNewTurn()
140139
_currentParticipant = 0;
141140
}
142141

143-
ChooseRandomNavigatorFromListWithout();
142+
var navigator = GetRandomNavigatorFromListWithout(
143+
_pairCodingSession.Participants[_currentParticipant],
144+
_pairCodingSession.Participants,
145+
random);
146+
recommendedNavigator.Text = navigator;
144147

145148
activeParticipnat.Text = _pairCodingSession.Participants[_currentParticipant];
146149

@@ -149,23 +152,25 @@ private async void ChooseAnotherPairAndStartNewTurn()
149152
_explicitlyConfirmTurnChange
150153
);
151154

152-
var tcs = new TaskCompletionSource<object>();
153-
form.Closed += (s, e) => tcs.SetResult(null!);
155+
var taskCompletionSource = new TaskCompletionSource<object>();
156+
form.Closed += (s, e) => taskCompletionSource.SetResult(null!);
154157

155158
form.Show();
156159
form.Topmost = true;
157-
await tcs.Task;
160+
await taskCompletionSource.Task;
158161
timer.Start();
159162
Topmost = true;
160163
}
161164

162-
private void ChooseRandomNavigatorFromListWithout()
165+
private static string GetRandomNavigatorFromListWithout(string currentlyActiveParticipant, string[] participants, Random random)
163166
{
164-
var potentialNavigators =
165-
_pairCodingSession.Participants.ToArray();
167+
if (participants.Length == 1)
168+
return "";
166169

170+
var potentialNavigators = participants.Where((s) => s != currentlyActiveParticipant).ToArray();
167171
var randomEntry = potentialNavigators[random.Next(0, potentialNavigators.Length)];
168-
recommendedNavigator.Text = randomEntry;
172+
173+
return randomEntry;
169174
}
170175

171176
private void PauseButton_Click(object? sender, RoutedEventArgs args)

Source/VisualPairCoding/VisualPairCoding.AvaloniaUI/VisualPairCoding.AvaloniaUI.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>WinExe</OutputType>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
77
<TrimMode>copyused</TrimMode>
@@ -23,11 +23,11 @@
2323
<ItemGroup>
2424
<AvaloniaResource Include="Assets\\*" />
2525
<Content Include="Assets\coworkers.ico" />
26-
<PackageReference Include="Avalonia" Version="11.0.4" />
27-
<PackageReference Include="Avalonia.Desktop" Version="11.0.4" />
26+
<PackageReference Include="Avalonia" Version="11.2.3" />
27+
<PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
2828
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
29-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.4" />
30-
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.4" />
29+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
30+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.3" />
3131
<PackageReference Include="MessageBox.Avalonia-mainthread" Version="2.0.1" />
3232
</ItemGroup>
3333
<ItemGroup>

Source/VisualPairCoding/VisualPairCoding.BL.Tests/VisualPairCoding.BL.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<OutputType>Library</OutputType>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="altcover" Version="8.6.68" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
13-
<PackageReference Include="xunit" Version="2.5.0" />
14-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
11+
<PackageReference Include="altcover" Version="9.0.1" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
13+
<PackageReference Include="xunit" Version="2.9.3" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
<PrivateAssets>all</PrivateAssets>
1717
</PackageReference>

Source/VisualPairCoding/VisualPairCoding.BL/VisualPairCoding.BL.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

Source/VisualPairCoding/VisualPairCoding.Infrastructure/VisualPairCoding.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

Source/VisualPairCoding/VisualPairCoding.Interfaces/VisualPairCoding.Interfaces.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

0 commit comments

Comments
 (0)