mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
CodingStyle: Fixing windows's host warnings
This commit is contained in:
parent
aef5ce59cb
commit
c84baf67a6
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<NoWarn>CS1591;SA1601</NoWarn>
|
<NoWarn>CS1591;SA1600;SA1601</NoWarn>
|
||||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Kyoo.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Kyoo.ruleset</CodeAnalysisRuleSet>
|
||||||
<!-- <AnalysisMode>AllEnabledByDefault</AnalysisMode>-->
|
<!-- <AnalysisMode>AllEnabledByDefault</AnalysisMode>-->
|
||||||
|
@ -24,7 +24,7 @@ namespace Kyoo.Core.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Entity Framework's Database handle.
|
/// The Entity Framework's Database handle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected readonly DbContext Database;
|
protected DbContext Database { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The default sort order that will be used for this resource's type.
|
/// The default sort order that will be used for this resource's type.
|
||||||
|
@ -16,7 +16,8 @@ namespace Kyoo.Core.Api
|
|||||||
where T : class, IResource
|
where T : class, IResource
|
||||||
{
|
{
|
||||||
private readonly IRepository<T> _repository;
|
private readonly IRepository<T> _repository;
|
||||||
protected readonly Uri BaseURL;
|
|
||||||
|
protected Uri BaseURL { get; }
|
||||||
|
|
||||||
public CrudApi(IRepository<T> repository, Uri baseURL)
|
public CrudApi(IRepository<T> repository, Uri baseURL)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
<Project ToolsVersion="Current">
|
<Project ToolsVersion="Current">
|
||||||
<PropertyGroup>
|
|
||||||
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||||
|
|
||||||
<PropertyGroup Condition="$(IsWindows) == true">
|
<PropertyGroup Condition="$(IsWindows) == true">
|
||||||
|
@ -14,12 +14,14 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
#else
|
#else
|
||||||
private const string Environment = "Production";
|
private const string Environment = "Production";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application that overrides the default host.
|
/// The main entry point for the application that overrides the default host.
|
||||||
/// It adds a system trait for windows and since the host is build as a windows executable instead of a console
|
/// It adds a system trait for windows and since the host is build as a windows executable instead of a console
|
||||||
/// app, the console is not showed.
|
/// app, the console is not showed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="args">Command line arguments</param>
|
||||||
|
/// <returns>A <see cref="Task"/> representing the lifetime of the program.</returns>
|
||||||
public static Task Main(string[] args)
|
public static Task Main(string[] args)
|
||||||
{
|
{
|
||||||
Application application = new(Environment);
|
Application application = new(Environment);
|
||||||
@ -29,4 +31,4 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
System.Windows.Forms.Application.Exit();
|
Application.Exit();
|
||||||
_thread?.Join();
|
_thread?.Join();
|
||||||
_thread = null;
|
_thread = null;
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
_options = options;
|
_options = options;
|
||||||
|
|
||||||
AppDomain.CurrentDomain.ProcessExit += (_, _) => Dispose();
|
AppDomain.CurrentDomain.ProcessExit += (_, _) => Dispose();
|
||||||
System.Windows.Forms.Application.ApplicationExit += (_, _) => Dispose();
|
Application.ApplicationExit += (_, _) => Dispose();
|
||||||
|
|
||||||
_icon = new NotifyIcon
|
_icon = new NotifyIcon
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ namespace Kyoo.Host.WindowsTrait
|
|||||||
public static void Run(IApplication application, IOptions<BasicOptions> options)
|
public static void Run(IApplication application, IOptions<BasicOptions> options)
|
||||||
{
|
{
|
||||||
using InternalSystemTrait trait = new(application, options);
|
using InternalSystemTrait trait = new(application, options);
|
||||||
System.Windows.Forms.Application.Run(trait);
|
Application.Run(trait);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -41,6 +41,5 @@
|
|||||||
|
|
||||||
<Rule Id="SA1633" Action="None" /> <!-- FileMustHaveHeader TODO remove this, this is only temporary -->
|
<Rule Id="SA1633" Action="None" /> <!-- FileMustHaveHeader TODO remove this, this is only temporary -->
|
||||||
<Rule Id="SA1629" Action="None" /> <!-- DocumentationTextMustEndWithAPeriod TODO remove this, this is only temporary -->
|
<Rule Id="SA1629" Action="None" /> <!-- DocumentationTextMustEndWithAPeriod TODO remove this, this is only temporary -->
|
||||||
<Rule Id="SA1600" Action="None" /> <!-- ElementsMustBeDocumented TODO remove this, this is only temporary -->
|
|
||||||
</Rules>
|
</Rules>
|
||||||
</RuleSet>
|
</RuleSet>
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||||
"settings": {
|
"settings": {
|
||||||
|
"documentationRules": {
|
||||||
|
"copyrightText": "Copyright (c) {companyName}. All rights reserved.\nLicensed under the {licenseName} license. See {licenseFile} file in the project root for full license information.",
|
||||||
|
"variables": {
|
||||||
|
"licenseName": "GPL-3.0",
|
||||||
|
"licenseFile": "LICENSE"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user