-
Notifications
You must be signed in to change notification settings - Fork 1
尺寸解析结构优化,新增结构化类型与接口 #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using System.Collections.Generic; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| namespace LuYao.Globalization; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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> |
| 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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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, | |
| } |
| 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, | ||
| } |
There was a problem hiding this comment.
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').