Skip to content

Commit

Permalink
BoxBorder.Empty → BoxBorder.Default
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenyagusev committed Feb 10, 2022
1 parent 49db935 commit 64a087c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
9 changes: 8 additions & 1 deletion src/BookFx/BoxBorder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace BookFx
{
using System;
using System.Drawing;
using BookFx.Cores;
using JetBrains.Annotations;
Expand All @@ -10,10 +11,16 @@
[PublicAPI]
public sealed class BoxBorder
{
/// <summary>
/// The default <see cref="BoxBorder"/>. All border parts are thin.
/// </summary>
public static readonly BoxBorder Default = BoxBorderCore.Default;

/// <summary>
/// The empty <see cref="BoxBorder"/>.
/// </summary>
public static readonly BoxBorder Empty = BoxBorderCore.Empty;
[Obsolete("Use Default instead.")]
public static readonly BoxBorder Empty = BoxBorderCore.Default;

private BoxBorder(BoxBorderCore core) => Get = core;

Expand Down
4 changes: 2 additions & 2 deletions src/BookFx/Cores/BoxBorderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[PublicAPI]
public sealed class BoxBorderCore
{
internal static readonly BoxBorderCore Empty = new BoxBorderCore(
internal static readonly BoxBorderCore Default = new(
parts: None,
style: None,
color: None);
Expand Down Expand Up @@ -46,7 +46,7 @@ public sealed class BoxBorderCore
Option<BorderParts>? parts = null,
Option<BorderStyle>? style = null,
Option<Color>? color = null) =>
new BoxBorderCore(
new(
parts ?? Parts,
style ?? Style,
color ?? Color);
Expand Down
10 changes: 5 additions & 5 deletions src/BookFx/Make.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,24 +421,24 @@ public static class Make
Style(others.Prepend(b).Prepend(a));

/// <summary>
/// Creates an empty <see cref="BoxBorder"/>.
/// Creates a default <see cref="BoxBorder"/>. All border parts are thin.
/// </summary>
[Pure]
public static BoxBorder Border() => BoxBorder.Empty;
public static BoxBorder Border() => BoxBorder.Default;

/// <summary>
/// Creates a <see cref="BoxBorder"/> with restriction to a <paramref name="parts"/>.
/// </summary>
/// <param name="parts">Parts of border. This is a flags enum.</param>
[Pure]
public static BoxBorder Border(BorderParts parts) => BoxBorder.Empty.Restrict(parts);
public static BoxBorder Border(BorderParts parts) => BoxBorder.Default.Restrict(parts);

/// <summary>
/// Creates a <see cref="BoxBorder"/> a border style.
/// </summary>
/// <param name="style">The border style.</param>
[Pure]
public static BoxBorder Border(BorderStyle style) => BoxBorder.Empty.Style(style);
public static BoxBorder Border(BorderStyle style) => BoxBorder.Default.Style(style);

/// <summary>
/// Creates a <see cref="BoxBorder"/> with a <paramref name="style"/> applied to a <paramref name="parts"/>.
Expand All @@ -447,6 +447,6 @@ public static class Make
/// <param name="style">The border style.</param>
[Pure]
public static BoxBorder Border(BorderParts parts, BorderStyle style) =>
BoxBorder.Empty.Restrict(parts).Style(style);
BoxBorder.Default.Restrict(parts).Style(style);
}
}

0 comments on commit 64a087c

Please sign in to comment.