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>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>CS1591;SA1601</NoWarn>
|
||||
<NoWarn>CS1591;SA1600;SA1601</NoWarn>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Kyoo.ruleset</CodeAnalysisRuleSet>
|
||||
<!-- <AnalysisMode>AllEnabledByDefault</AnalysisMode>-->
|
||||
|
@ -24,7 +24,7 @@ namespace Kyoo.Core.Controllers
|
||||
/// <summary>
|
||||
/// The Entity Framework's Database handle.
|
||||
/// </summary>
|
||||
protected readonly DbContext Database;
|
||||
protected DbContext Database { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
{
|
||||
private readonly IRepository<T> _repository;
|
||||
protected readonly Uri BaseURL;
|
||||
|
||||
protected Uri BaseURL { get; }
|
||||
|
||||
public CrudApi(IRepository<T> repository, Uri baseURL)
|
||||
{
|
||||
|
@ -1,8 +1,4 @@
|
||||
<Project ToolsVersion="Current">
|
||||
<PropertyGroup>
|
||||
<IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
||||
|
||||
<PropertyGroup Condition="$(IsWindows) == true">
|
||||
|
@ -20,6 +20,8 @@ namespace Kyoo.Host.WindowsTrait
|
||||
/// 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.
|
||||
/// </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)
|
||||
{
|
||||
Application application = new(Environment);
|
||||
|
@ -55,7 +55,7 @@ namespace Kyoo.Host.WindowsTrait
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
System.Windows.Forms.Application.Exit();
|
||||
Application.Exit();
|
||||
_thread?.Join();
|
||||
_thread = null;
|
||||
}
|
||||
@ -92,7 +92,7 @@ namespace Kyoo.Host.WindowsTrait
|
||||
_options = options;
|
||||
|
||||
AppDomain.CurrentDomain.ProcessExit += (_, _) => Dispose();
|
||||
System.Windows.Forms.Application.ApplicationExit += (_, _) => Dispose();
|
||||
Application.ApplicationExit += (_, _) => Dispose();
|
||||
|
||||
_icon = new NotifyIcon
|
||||
{
|
||||
@ -125,7 +125,7 @@ namespace Kyoo.Host.WindowsTrait
|
||||
public static void Run(IApplication application, IOptions<BasicOptions> options)
|
||||
{
|
||||
using InternalSystemTrait trait = new(application, options);
|
||||
System.Windows.Forms.Application.Run(trait);
|
||||
Application.Run(trait);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -41,6 +41,5 @@
|
||||
|
||||
<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="SA1600" Action="None" /> <!-- ElementsMustBeDocumented TODO remove this, this is only temporary -->
|
||||
</Rules>
|
||||
</RuleSet>
|
||||
|
@ -1,6 +1,12 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||
"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