Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/LuYao.Common/Globalization/Dimension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;

namespace LuYao.Globalization;

Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public API type DimensionItem lacks XML documentation. Add a summary comment explaining what a DimensionItem represents (e.g., 'Represents a single dimension value with its associated kind').

Suggested change
/// <summary>
/// Represents a single dimension value together with its associated kind.
/// </summary>

Copilot uses AI. Check for mistakes.
public record struct DimensionItem(DimensionKind Kind, decimal Value);

public class Dimension
{
public DimensionUnit Unit { get; set; } = DimensionUnit.Centimeter;
public List<DimensionItem> Items { get; set; } = new List<DimensionItem>();
Comment on lines +4 to +10
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public API class Dimension and its properties lack XML documentation. Add summary comments to explain the purpose of this class and each property.

Suggested change
public record struct DimensionItem(DimensionKind Kind, decimal Value);
public class Dimension
{
public DimensionUnit Unit { get; set; } = DimensionUnit.Centimeter;
public List<DimensionItem> Items { get; set; } = new List<DimensionItem>();
/// <summary>
/// Represents a single dimension value along with its associated kind.
/// </summary>
/// <param name="Kind">The kind or category of the dimension value.</param>
/// <param name="Value">The numeric value of the dimension.</param>
public record struct DimensionItem(DimensionKind Kind, decimal Value);
/// <summary>
/// Represents a collection of dimension measurements expressed in a specific unit.
/// </summary>
public class Dimension
{
/// <summary>
/// Gets or sets the unit of measurement used for the dimension items.
/// </summary>
public DimensionUnit Unit { get; set; } = DimensionUnit.Centimeter;
/// <summary>
/// Gets or sets the list of dimension items that compose this dimension.
/// </summary>
public List<DimensionItem> Items { get; set; } = new List<DimensionItem>();
/// <summary>
/// Gets a value indicating whether the dimension contains no items.
/// </summary>

Copilot uses AI. Check for mistakes.
public bool IsEmpty => Items.Count == 0;
}
30 changes: 30 additions & 0 deletions src/LuYao.Common/Globalization/DimensionKind.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuYao.Globalization;

/// <summary>
/// Specifies the type of dimension represented, such as length, width, or height.
/// </summary>
public enum DimensionKind
{
/// <summary>
/// 未指定
/// </summary>
Unspecified,
/// <summary>
/// 长度
/// </summary>
Length,
/// <summary>
/// 宽度
/// </summary>
Width,
/// <summary>
/// 高度
/// </summary>
Height,
}
Comment on lines +1 to +30
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports detected. The file only contains an enum definition and doesn't use System, System.Collections.Generic, System.Linq, System.Text, or System.Threading.Tasks. Remove these unused imports to keep the code clean.

Suggested change
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LuYao.Globalization;
/// <summary>
/// Specifies the type of dimension represented, such as length, width, or height.
/// </summary>
public enum DimensionKind
{
/// <summary>
/// 未指定
/// </summary>
Unspecified,
/// <summary>
/// 长度
/// </summary>
Length,
/// <summary>
/// 宽度
/// </summary>
Width,
/// <summary>
/// 高度
/// </summary>
Height,
}
namespace LuYao.Globalization;
/// <summary>
/// Specifies the type of dimension represented, such as length, width, or height.
/// </summary>
public enum DimensionKind
{
/// <summary>
/// 未指定
/// </summary>
Unspecified,
/// <summary>
/// 长度
/// </summary>
Length,
/// <summary>
/// 宽度
/// </summary>
Width,
/// <summary>
/// 高度
/// </summary>
Height,
}

Copilot uses AI. Check for mistakes.
16 changes: 16 additions & 0 deletions src/LuYao.Common/Globalization/DimensionUnit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace LuYao.Globalization;

/// <summary>
/// 长度单位
/// </summary>
public enum DimensionUnit
{
/// <summary>
/// 厘米
/// </summary>
Centimeter,
/// <summary>
/// 英寸
/// </summary>
Inch,
}
Loading
Loading