Mark exposed fields and methods

This commit is contained in:
2024-02-12 02:01:31 +01:00
parent cbca4fd7de
commit bb8959160a
10 changed files with 23 additions and 15 deletions

View File

@ -5,6 +5,7 @@ namespace CShocker.Shockers.Abstract;
public abstract class Shocker : IDisposable
{
// ReSharper disable once MemberCanBePrivate.Global -> Exposed
public Api Api { get; }
internal Shocker(Api api)

View File

@ -22,7 +22,6 @@ public class ShockerJsonConverter : JsonConverter
{
return jo.ToObject<PiShockShocker>(serializer)!;
}
throw new Exception();
}
public override bool CanWrite => false;
@ -32,6 +31,6 @@ public class ShockerJsonConverter : JsonConverter
/// </summary>
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
throw new Exception("Dont call this");
throw new NotImplementedException("Dont call this");
}
}

View File

@ -1,13 +1,16 @@
using System.Diagnostics.CodeAnalysis;
using CShocker.Devices.Abstract;
using CShocker.Devices.Abstract;
using CShocker.Shockers.Abstract;
namespace CShocker.Shockers;
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[SuppressMessage("ReSharper", "InconsistentNaming")]
public class OpenShockShocker : Shocker
{
// ReSharper disable thrice MemberCanBePrivate.Global -> Exposed
public readonly string Name, ID;
public readonly short RfId;
public readonly OpenShockModel Model;
public readonly DateTime CreatedOn;
public readonly bool IsPaused;
public string name, id;
public short rfId;
public OpenShockModel model;

View File

@ -5,7 +5,7 @@ namespace CShocker.Shockers;
public class PiShockShocker : Shocker
{
public string Code;
public readonly string Code;
public override bool Equals(object? obj)
{