Skip to content

Commit

Permalink
Use readonly structs
Browse files Browse the repository at this point in the history
  • Loading branch information
chubrik committed May 12, 2022
1 parent 48d7b6e commit 7b5306c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions XConsole/XConsoleItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
using System;
using System.Diagnostics;

internal struct XConsoleItem
internal readonly struct XConsoleItem
{
public const ConsoleColor NoColor = (ConsoleColor)(-1);

public readonly string Value;
public readonly ConsoleColor BackColor;
public readonly ConsoleColor ForeColor;
public string Value { get; }
public ConsoleColor BackColor { get; }
public ConsoleColor ForeColor { get; }

private XConsoleItem(string value, ConsoleColor backColor, ConsoleColor foreColor)
{
Expand Down
8 changes: 4 additions & 4 deletions XConsole/XConsolePosition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
#endif
public struct XConsolePosition
public readonly struct XConsolePosition
{
public readonly int Left;
public readonly int InitialTop;
internal readonly long ShiftTop;
public int Left { get; }
public int InitialTop { get; }
internal long ShiftTop { get; }

public XConsolePosition(int left, int top)
{
Expand Down

0 comments on commit 7b5306c

Please sign in to comment.