Skip to content

Commit

Permalink
Menu improvements remove async/await in menu (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
coenm authored May 22, 2024
1 parent 533b5c1 commit a92acd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="Broslyn" Version="1.2.0" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.7.8" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.2.243" />
<PackageReference Include="Scriban" Version="5.9.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
</ItemGroup>
Expand Down
11 changes: 5 additions & 6 deletions src/RepoM.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace RepoM.App;
using System.Diagnostics;
using System.IO.Abstractions;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
Expand Down Expand Up @@ -285,15 +284,15 @@ private async Task<bool> LstRepositoriesContextMenuOpeningAsync(ContextMenu ctxM
}
else if (action is DeferredSubActionsUserInterfaceRepositoryAction deferredAction)
{
Control? controlItem = await CreateMenuItemNewStyleAsync(action, vm).ConfigureAwait(true);
Control? controlItem = CreateMenuItemNewStyleAsync(action, vm);
if (controlItem != null)
{
items.Add(controlItem);
}
}
else if (action is UserInterfaceRepositoryAction uiAction)
{
Control? controlItem = await CreateMenuItemNewStyleAsync(action, vm).ConfigureAwait(true);
Control? controlItem = CreateMenuItemNewStyleAsync(action, vm);
if (controlItem != null)
{
items.Add(controlItem);
Expand Down Expand Up @@ -582,7 +581,7 @@ void SelfDetachingEventHandler(object _, RoutedEventArgs evtArgs)
return item;
}

private async Task<Control?> /*MenuItem*/ CreateMenuItemNewStyleAsync(UserInterfaceRepositoryActionBase action, RepositoryViewModel? affectedViews = null)
private Control? /*MenuItem*/ CreateMenuItemNewStyleAsync(UserInterfaceRepositoryActionBase action, RepositoryViewModel? affectedViews = null)
{
if (action is UserInterfaceSeparatorRepositoryAction)
{
Expand Down Expand Up @@ -641,7 +640,7 @@ async void SelfDetachingEventHandler(object _, RoutedEventArgs evtArgs)

foreach (UserInterfaceRepositoryActionBase subAction in await deferredRepositoryAction.GetAsync().ConfigureAwait(true))
{
Control? controlItem = await CreateMenuItemNewStyleAsync(subAction).ConfigureAwait(true);
Control? controlItem = CreateMenuItemNewStyleAsync(subAction);
if (controlItem == null)
{
continue;
Expand Down Expand Up @@ -681,7 +680,7 @@ async void SelfDetachingEventHandler1(object _, RoutedEventArgs evtArgs)

foreach (UserInterfaceRepositoryActionBase subAction in repositoryAction.SubActions)
{
Control? controlItem = await CreateMenuItemNewStyleAsync(subAction).ConfigureAwait(true);
Control? controlItem = CreateMenuItemNewStyleAsync(subAction);
if (controlItem == null)
{
continue;
Expand Down

0 comments on commit a92acd1

Please sign in to comment.