Skip to content

Commit

Permalink
Merge pull request #15 from alex-oswald/dev
Browse files Browse the repository at this point in the history
Fix circular dependency issue. Bump deps.
  • Loading branch information
alex-oswald authored Mar 29, 2022
2 parents ca73256 + 2e92193 commit 1f61012
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions samples/MvpSample/MvpSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageId>WindowsFormsLifetime.Mvp</PackageId>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>Alex Oswald</Authors>
<Company>Oswald Technologies, LLC</Company>
<Description>Model-View-Presenter extensions for WindowsFormsLifetime</Description>
Expand Down
9 changes: 5 additions & 4 deletions src/WindowsFormsLifetime/FormProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ public class FormProvider : IFormProvider
{
private readonly SemaphoreSlim _semaphore = new(1, 1);
private readonly IServiceProvider _serviceProvider;
private readonly ApplicationContext _applicationContext;
private readonly IWindowsFormsSynchronizationContextProvider _syncContextManager;

public FormProvider(
IServiceProvider serviceProvider,
ApplicationContext applicationContext,
IWindowsFormsSynchronizationContextProvider syncContextManager)
{
_serviceProvider = serviceProvider;
_applicationContext = applicationContext;
_syncContextManager = syncContextManager;
}

Expand All @@ -44,6 +41,10 @@ public async Task<T> GetFormAsync<T>()
return form;
}

public Task<Form> GetMainFormAsync() => Task.FromResult(_applicationContext.MainForm);
public Task<Form> GetMainFormAsync()
{
var applicationContext = _serviceProvider.GetService<ApplicationContext>();
return Task.FromResult(applicationContext.MainForm);
}
}
}
4 changes: 2 additions & 2 deletions src/WindowsFormsLifetime/WindowsFormsLifetime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageId>OswaldTechnologies.Extensions.Hosting.WindowsFormsLifetime</PackageId>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>Alex Oswald</Authors>
<Company>Oswald Technologies, LLC</Company>
<Description>.NET Core hosting infrastructure for Windows Forms.</Description>
Expand Down Expand Up @@ -33,7 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 1f61012

Please sign in to comment.