mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-05-07 00:34:03 +02:00
Fix or suppress several ReSharper warnings
This commit is contained in:
parent
f5e01716ed
commit
69f3fbcbf4
Agent/Phantom.Agent.Services/Instances
Common/Phantom.Common.Data/Minecraft
Server
Phantom.Server.Database/Entities
Phantom.Server.Web.Components/Utils
@ -53,6 +53,6 @@ sealed class PortManager {
|
||||
ServerPortNotAllowed,
|
||||
ServerPortAlreadyInUse,
|
||||
RconPortNotAllowed,
|
||||
RconPortAlreadyInUse,
|
||||
RconPortAlreadyInUse
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ public enum MinecraftVersionType : ushort {
|
||||
Release = 1,
|
||||
Snapshot = 2,
|
||||
OldBeta = 3,
|
||||
OldAlpha = 4,
|
||||
OldAlpha = 4
|
||||
}
|
||||
|
||||
public static class MinecraftVersionTypes {
|
||||
|
@ -1,10 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Phantom.Common.Data;
|
||||
|
||||
namespace Phantom.Server.Database.Entities;
|
||||
|
||||
[Table("Agents", Schema = "agents")]
|
||||
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||
public sealed class AgentEntity {
|
||||
[Key]
|
||||
public Guid AgentGuid { get; set; }
|
||||
|
@ -8,9 +8,12 @@ using Phantom.Server.Database.Enums;
|
||||
namespace Phantom.Server.Database.Entities;
|
||||
|
||||
[Table("AuditEvents", Schema = "system")]
|
||||
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||
[SuppressMessage("ReSharper", "ClassWithVirtualMembersNeverInherited.Global")]
|
||||
public class AuditEventEntity : IDisposable {
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public long Id { get; set; }
|
||||
|
||||
public string? UserId { get; set; }
|
||||
|
@ -7,6 +7,7 @@ using Phantom.Common.Data.Minecraft;
|
||||
namespace Phantom.Server.Database.Entities;
|
||||
|
||||
[Table("Instances", Schema = "agents")]
|
||||
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public sealed class InstanceEntity {
|
||||
[Key]
|
||||
|
@ -1,8 +1,10 @@
|
||||
using System.Globalization;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Phantom.Server.Web.Components.Utils;
|
||||
|
||||
static class BlazorUtils {
|
||||
[SuppressMessage("ReSharper", "ConvertIfStatementToReturnStatement")]
|
||||
public static string? CombineClassNames(IReadOnlyDictionary<string, object>? additionalAttributes, string? classNames) {
|
||||
if (additionalAttributes is null || !additionalAttributes.TryGetValue("class", out var @class)) {
|
||||
return classNames;
|
||||
@ -21,6 +23,7 @@ static class BlazorUtils {
|
||||
return $"{classAttributeValue} {classNames}";
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "MergeAndPattern")]
|
||||
public static bool CombineBooleansWithOr(IReadOnlyDictionary<string, object>? additionalAttributes, string attributeName, bool value) {
|
||||
return value || (additionalAttributes is not null && additionalAttributes.TryGetValue(attributeName, out var @bool) && @bool is bool and true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user