Skip to content

Commit 130ba17

Browse files
committed
更新文档
1 parent 69679eb commit 130ba17

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* `net5.0`
2525
* `net6.0`
2626
* `net7.0`
27+
* `net8.0`
2728

2829
## 使用
2930
查看[在线文档](https://commonlibs.jiuling.me)

docs/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,38 @@ y.Add("a1", "b1");
1717
Assert.IsTrue(_myComparer.Equals(x, y));
1818
```
1919

20+
# `Enums` 命名空间
21+
常用的一些枚举定义。
22+
23+
## `VersionFormatEnum` 枚举
24+
版本号展示格式。
25+
26+
```C#
27+
public enum VersionFormatEnum
28+
{
29+
/// <summary>
30+
/// 主版本(1)
31+
/// 例如:1
32+
/// </summary>
33+
Major = 1,
34+
/// <summary>
35+
/// 主版本.次版本
36+
/// 例如:1.2
37+
/// </summary>
38+
MajorMinor = 2,
39+
/// <summary>
40+
/// 主版本.次版本.构建版本
41+
/// 例如:1.2.3
42+
/// </summary>
43+
MajorMinorBuild = 3,
44+
/// <summary>
45+
/// 主版本.次版本.构建版本.修订版本
46+
/// 例如:1.2.3.4
47+
/// </summary>
48+
MajorMinorBuildRevision = 4
49+
}
50+
```
51+
2052
# `ExtensionMethods` 命名空间
2153
该命名空间下是一些通用的扩展方法。
2254

@@ -75,6 +107,16 @@ a.ToDataTable();
75107
"https://jiuling.me".ToUri(); //将字符串转为 Uri 对象
76108
```
77109

110+
## `VersionExtension`
111+
版本号的扩展方法。
112+
113+
```C#
114+
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.Major); // 结果为字符串 "1"
115+
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.MajorMinor); // 结果为字符串 "1.2"
116+
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.MajorMinorBuild); // 结果为字符串 "1.2.3"
117+
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.MajorMinorBuildRevision); // 结果为字符串 "1.2.3.4"
118+
```
119+
78120
# `Log` 命名空间
79121
该命名空间下是一些通用的日志帮助类。
80122

0 commit comments

Comments
 (0)