Skip to content

Commit

Permalink
更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuLing-zhang committed Sep 6, 2024
1 parent 69679eb commit 130ba17
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* `net5.0`
* `net6.0`
* `net7.0`
* `net8.0`

## 使用
查看[在线文档](https://commonlibs.jiuling.me)
Expand Down
42 changes: 42 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ y.Add("a1", "b1");
Assert.IsTrue(_myComparer.Equals(x, y));
```

# `Enums` 命名空间
常用的一些枚举定义。

## `VersionFormatEnum` 枚举
版本号展示格式。

```C#
public enum VersionFormatEnum
{
/// <summary>
/// 主版本(1)
/// 例如:1
/// </summary>
Major = 1,
/// <summary>
/// 主版本.次版本
/// 例如:1.2
/// </summary>
MajorMinor = 2,
/// <summary>
/// 主版本.次版本.构建版本
/// 例如:1.2.3
/// </summary>
MajorMinorBuild = 3,
/// <summary>
/// 主版本.次版本.构建版本.修订版本
/// 例如:1.2.3.4
/// </summary>
MajorMinorBuildRevision = 4
}
```

# `ExtensionMethods` 命名空间
该命名空间下是一些通用的扩展方法。

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

## `VersionExtension`
版本号的扩展方法。

```C#
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.Major); // 结果为字符串 "1"
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.MajorMinor); // 结果为字符串 "1.2"
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.MajorMinorBuild); // 结果为字符串 "1.2.3"
(new Version("1.2.3.4")).ToFormatString(VersionFormatEnum.MajorMinorBuildRevision); // 结果为字符串 "1.2.3.4"
```

# `Log` 命名空间
该命名空间下是一些通用的日志帮助类。

Expand Down

0 comments on commit 130ba17

Please sign in to comment.