Skip to content

Commit

Permalink
use explicit acess modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrabbers committed Mar 30, 2024
1 parent b81bd94 commit bbe94e1
Show file tree
Hide file tree
Showing 44 changed files with 259 additions and 271 deletions.
115 changes: 0 additions & 115 deletions .editorconfig

This file was deleted.

2 changes: 1 addition & 1 deletion BnbnavNetClient.I18Next/CldrPluralResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace BnbnavNetClient.I18Next;

public sealed class CldrPluralResolver : IPluralResolver
{
static readonly string[] SuffixOrder = new[]
private static readonly string[] SuffixOrder = new[]
{
"zero",
"one",
Expand Down
6 changes: 3 additions & 3 deletions BnbnavNetClient.I18Next/JsonResourcesFileBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace BnbnavNetClient.I18Next;

public sealed class JsonResourcesFileBackend : ITranslationBackend
{
readonly string _basePath;
readonly ITranslationTreeBuilderFactory _treeBuilderFactory;
readonly Assembly _assembly;
private readonly string _basePath;
private readonly ITranslationTreeBuilderFactory _treeBuilderFactory;
private readonly Assembly _assembly;

public JsonResourcesFileBackend(Assembly assembly, string basePath)
: this(assembly, basePath, new GenericTranslationTreeBuilderFactory<HierarchicalTranslationTreeBuilder>())
Expand Down
6 changes: 3 additions & 3 deletions BnbnavNetClient.I18Next/Pseudo/PseudoLocalizationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ namespace BnbnavNetClient.I18Next.Pseudo;

public class PseudoLocalizationOptions
{
int _letterMultiplier = 2;
private int _letterMultiplier = 2;

char[] _repeatedLetters =
private char[] _repeatedLetters =
{
'a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y'
};

IDictionary<char, char> _letters = new Dictionary<char, char>
private IDictionary<char, char> _letters = new Dictionary<char, char>
{
{ 'a', 'α' },
{ 'b', 'ḅ' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace BnbnavNetClient.I18Next.Pseudo;

public class PseudoLocalizationPostProcessor : IPostProcessor
{
readonly PseudoLocalizationOptions _options;
private readonly PseudoLocalizationOptions _options;

public string Process(string key, string value, IDictionary<string, object> args)
{
Expand Down
7 changes: 4 additions & 3 deletions BnbnavNetClient.I18Next/Services/AvaloniaI18Next.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
using BnbnavNetClient.I18Next.Pseudo;

namespace BnbnavNetClient.I18Next.Services;
sealed class AvaloniaI18Next : IAvaloniaI18Next

internal sealed class AvaloniaI18Next : IAvaloniaI18Next
{
I18NextNet? _i18Next;
private I18NextNet? _i18Next;

public string this[string key, Dictionary<string, object?>? arguments]
{
Expand Down Expand Up @@ -48,7 +49,7 @@ public CultureInfo CurrentLanguage
}
}

void IsNotNull()
private void IsNotNull()
{
if (_i18Next is null)
throw new InvalidOperationException("IAvaloniaI18Next.Initialize(...) must be called before translations are accessed.");
Expand Down
12 changes: 6 additions & 6 deletions BnbnavNetClient.I18Next/TrString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace BnbnavNetClient.I18Next;
public sealed class TrString : AvaloniaObject
{
readonly IAvaloniaI18Next _tr;
private readonly IAvaloniaI18Next _tr;

string _key = string.Empty;
private string _key = string.Empty;
public string Key
{
get => _key;
Expand All @@ -16,7 +16,7 @@ public string Key
public static readonly DirectProperty<TrString, string> KeyProperty =
AvaloniaProperty.RegisterDirect<TrString, string>(nameof(Key), me => me.Key, (me, val) => me.Key = val);

int? _count;
private int? _count;
public int? Count
{
get => _count;
Expand All @@ -25,7 +25,7 @@ public int? Count
public static readonly DirectProperty<TrString, int?> CountProperty =
AvaloniaProperty.RegisterDirect<TrString, int?>(nameof(Count), me => me.Count, (me, val) => me.Count = val);

IEnumerable<TrArgument> _arguments = new List<TrArgument>();
private IEnumerable<TrArgument> _arguments = new List<TrArgument>();
public IEnumerable<TrArgument> Arguments
{
get => _arguments;
Expand Down Expand Up @@ -59,7 +59,7 @@ public override string ToString()
}
public sealed class TrArgument : AvaloniaObject
{
string _name = string.Empty;
private string _name = string.Empty;
public string Name
{
get => _name;
Expand All @@ -68,7 +68,7 @@ public string Name
public static readonly DirectProperty<TrArgument, string> NameProperty =
AvaloniaProperty.RegisterDirect<TrArgument, string>(nameof(Name), me => me.Name, (me, val) => me.Name = val);

object? _value;
private object? _value;
public object? Value
{
get => _value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using BnbnavNetClient.Services.TextToSpeech;

namespace BnbnavNetClient.Windows.TextToSpeech;
class WindowsTextToSpeechProvider : ITextToSpeechProvider

internal class WindowsTextToSpeechProvider : ITextToSpeechProvider
{
SpeechSynthesizer _speechSynthesizer;
private SpeechSynthesizer _speechSynthesizer;

public WindowsTextToSpeechProvider()
{
Expand Down
1 change: 0 additions & 1 deletion BnbnavNetClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BnbnavNetClient.Windows", "
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3DA99C4E-89E3-4049-9C22-0A7EC60D83D8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Expand Down
4 changes: 2 additions & 2 deletions BnbnavNetClient/Controls/DayNightButton.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public bool IsNightMode
set => SetValue(IsNightModeProperty, value);
}

Button _button = null!;
private Button _button = null!;
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
Expand All @@ -33,7 +33,7 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
_button.Click += ButtonClick;
}

void ButtonClick(object? sender, RoutedEventArgs e)
private void ButtonClick(object? sender, RoutedEventArgs e)
{
IsNightMode = !IsNightMode;
RaiseEvent(new RoutedEventArgs(ClickEvent));
Expand Down
14 changes: 7 additions & 7 deletions BnbnavNetClient/Controls/InstructionDisplayControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ namespace BnbnavNetClient.Controls;

public class InstructionDisplayControl : TemplatedControl
{
CalculatedRoute.Instruction? _instruction;
private CalculatedRoute.Instruction? _instruction;
public static readonly DirectProperty<InstructionDisplayControl, CalculatedRoute.Instruction?> InstructionProperty = AvaloniaProperty.RegisterDirect<InstructionDisplayControl, CalculatedRoute.Instruction?>("Instruction", o => o.Instruction, (o, v) => o.Instruction = v);
int? _toNextInstruction;

private int? _toNextInstruction;
public static readonly DirectProperty<InstructionDisplayControl, int?> ToNextInstructionProperty = AvaloniaProperty.RegisterDirect<InstructionDisplayControl, int?>("ToNextInstruction", o => o.ToNextInstruction, (o, v) => o.ToNextInstruction = v);
string _calculatedInstructionLength = "";

private string _calculatedInstructionLength = "";
public static readonly DirectProperty<InstructionDisplayControl, string> CalculatedInstructionLengthProperty = AvaloniaProperty.RegisterDirect<InstructionDisplayControl, string>("CalculatedInstructionLength", o => o.CalculatedInstructionLength, (o, v) => o.CalculatedInstructionLength = v);
Thickness _innerMargin;

private Thickness _innerMargin;
public static readonly DirectProperty<InstructionDisplayControl, Thickness> InnerMarginProperty = AvaloniaProperty.RegisterDirect<InstructionDisplayControl, Thickness>("InnerMargin", o => o.InnerMargin, (o, v) => o.InnerMargin = v);

public CalculatedRoute.Instruction? Instruction
Expand Down
2 changes: 1 addition & 1 deletion BnbnavNetClient/Controls/InstructionImageControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace BnbnavNetClient.Controls;

public class InstructionImageControl : TemplatedControl
{
CalculatedRoute.Instruction? _instruction;
private CalculatedRoute.Instruction? _instruction;
public static readonly DirectProperty<InstructionImageControl, CalculatedRoute.Instruction?> InstructionProperty = AvaloniaProperty.RegisterDirect<InstructionImageControl, CalculatedRoute.Instruction?>("Instruction", o => o.Instruction, (o, v) => o.Instruction = v);

public CalculatedRoute.Instruction? Instruction
Expand Down
10 changes: 5 additions & 5 deletions BnbnavNetClient/Controls/LandmarkSearchControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ namespace BnbnavNetClient.Controls;

public class LandmarkSearchControl : TemplatedControl
{
ISearchable? _selectedLandmark;
private ISearchable? _selectedLandmark;
public static readonly DirectProperty<LandmarkSearchControl, ISearchable?> SelectedLandmarkProperty = AvaloniaProperty.RegisterDirect<LandmarkSearchControl, ISearchable?>("SelectedLandmark", o => o.SelectedLandmark, (o, v) => o.SelectedLandmark = v, defaultBindingMode: BindingMode.TwoWay);
MapService _mapService = null!;
private MapService _mapService = null!;
public static readonly DirectProperty<LandmarkSearchControl, MapService> MapServiceProperty = AvaloniaProperty.RegisterDirect<LandmarkSearchControl, MapService>("MapService", o => o.MapService, (o, v) => o.MapService = v);

string _searchQuery = null!;
private string _searchQuery = null!;
public static readonly DirectProperty<LandmarkSearchControl, string> SearchQueryProperty = AvaloniaProperty.RegisterDirect<LandmarkSearchControl, string>(
"SearchQuery", o => o.SearchQuery, (o, v) => o.SearchQuery = v);

AvaloniaList<ISearchable> _searchResults = [];
private AvaloniaList<ISearchable> _searchResults = [];
public static readonly DirectProperty<LandmarkSearchControl, AvaloniaList<ISearchable>> SearchResultsProperty = AvaloniaProperty.RegisterDirect<LandmarkSearchControl, AvaloniaList<ISearchable>>(
"SearchResults", o => o.SearchResults, (o, v) => o.SearchResults = v);

string _chosenWorld = null!;
private string _chosenWorld = null!;
public static readonly DirectProperty<LandmarkSearchControl, string> ChosenWorldProperty = AvaloniaProperty.RegisterDirect<LandmarkSearchControl, string>(
"ChosenWorld", o => o.ChosenWorld, (o, v) => o.ChosenWorld = v);

Expand Down
2 changes: 1 addition & 1 deletion BnbnavNetClient/Helpers/DrawingContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace BnbnavNetClient.Helpers;

public static class DrawingContextExtensions
{
static readonly Dictionary<string, SKSvg> SvgCache = new();
private static readonly Dictionary<string, SKSvg> SvgCache = new();

public static void DrawSvgUrl(this DrawingContext context, string? url, Rect rect, double angle = 0)
{
Expand Down
Loading

0 comments on commit bbe94e1

Please sign in to comment.