Skip to content

Commit 7c05036

Browse files
committed
升级SDK版本到.Net6
清理代码
1 parent 7bccd2b commit 7c05036

File tree

159 files changed

+11405
-11428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+11405
-11428
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

Sora/Attributes/CodeReview.cs

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
11
using System;
22

3-
namespace Sora.Attributes
4-
{
5-
//TODO:代码审核规范(必读)
6-
//对于有疑问的代码可以使用TODO进行疑问,相应维护者应该及时进行回复
7-
//下面所有用法前面都请带上TODO和冒号
8-
//例:Problem:这里需要检查是否可能存在的空值(这里TODO后面需要加冒号)
9-
//答:Checked:这里不存在空值异常,可以正常使用
10-
//并留下这段注释,以便以后复查时理解。
11-
//
12-
//对于改进,请使用Advise
13-
//相应维护者看见后应该做出回应,无论是进行相应修改还是给出Reply(不采纳原因)
14-
//提出建议者应该在看见Reply后把Reply删除以证明自己看见了
15-
//或者也可以继续提出其他Advise。
16-
//例:Advise:采用自定义数据结构
17-
//答:Reply:不采用,因为只有这一处修改(这句话看见后,包括Advise和Reply都会被删除)
3+
namespace Sora.Attributes;
4+
//TODO:代码审核规范(必读)
5+
//对于有疑问的代码可以使用TODO进行疑问,相应维护者应该及时进行回复
6+
//下面所有用法前面都请带上TODO和冒号
7+
//例:Problem:这里需要检查是否可能存在的空值(这里TODO后面需要加冒号)
8+
//答:Checked:这里不存在空值异常,可以正常使用
9+
//并留下这段注释,以便以后复查时理解。
10+
//
11+
//对于改进,请使用Advise
12+
//相应维护者看见后应该做出回应,无论是进行相应修改还是给出Reply(不采纳原因)
13+
//提出建议者应该在看见Reply后把Reply删除以证明自己看见了
14+
//或者也可以继续提出其他Advise。
15+
//例:Advise:采用自定义数据结构
16+
//答:Reply:不采用,因为只有这一处修改(这句话看见后,包括Advise和Reply都会被删除)
1817

18+
/// <summary>
19+
/// 代码审核特性类
20+
/// </summary>
21+
[AttributeUsage(AttributeTargets.Method)]
22+
public class Reviewed : Attribute
23+
{
1924
/// <summary>
20-
/// 代码审核特性类
25+
/// 审核者
2126
/// </summary>
22-
[AttributeUsage(AttributeTargets.Method)]
23-
public class Reviewed : Attribute
24-
{
25-
/// <summary>
26-
/// 审核者
27-
/// </summary>
28-
public string Person { get; }
27+
public string Person { get; }
2928

30-
/// <summary>
31-
/// 时间
32-
/// </summary>
33-
public string Time { get; }
29+
/// <summary>
30+
/// 时间
31+
/// </summary>
32+
public string Time { get; }
3433

35-
/// <summary>
36-
/// 表明您已经审核了该代码
37-
/// </summary>
38-
/// <param name="person">审核人</param>
39-
/// <param name="dt">时间</param>
40-
public Reviewed(string person, string dt)
41-
{
42-
Person = person;
43-
Time = dt;
44-
}
34+
/// <summary>
35+
/// 表明您已经审核了该代码
36+
/// </summary>
37+
/// <param name="person">审核人</param>
38+
/// <param name="dt">时间</param>
39+
public Reviewed(string person, string dt)
40+
{
41+
Person = person;
42+
Time = dt;
4543
}
44+
}
4645

46+
/// <summary>
47+
/// 需要审查特性类
48+
/// </summary>
49+
[AttributeUsage(AttributeTargets.Method)]
50+
public class NeedReview : Attribute
51+
{
4752
/// <summary>
48-
/// 需要审查特性类
53+
/// 修改的位置(行号或ALL)
4954
/// </summary>
50-
[AttributeUsage(AttributeTargets.Method)]
51-
public class NeedReview : Attribute
52-
{
53-
/// <summary>
54-
/// 修改的位置(行号或ALL)
55-
/// </summary>
56-
public string ModifiedLines { get; }
55+
public string ModifiedLines { get; }
5756

58-
/// <summary>
59-
/// 表明您认为这段代码需要审查
60-
/// </summary>
61-
/// <param name="lines">修改行号/ALL</param>
62-
public NeedReview(string lines)
63-
{
64-
ModifiedLines = lines;
65-
}
57+
/// <summary>
58+
/// 表明您认为这段代码需要审查
59+
/// </summary>
60+
/// <param name="lines">修改行号/ALL</param>
61+
public NeedReview(string lines)
62+
{
63+
ModifiedLines = lines;
6664
}
6765
}
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System;
22

3-
namespace Sora.Attributes.Command
3+
namespace Sora.Attributes.Command;
4+
5+
/// <summary>
6+
/// 指令组
7+
/// </summary>
8+
[AttributeUsage(AttributeTargets.Class)]
9+
public class CommandGroup : Attribute
410
{
5-
/// <summary>
6-
/// 指令组
7-
/// </summary>
8-
[AttributeUsage(AttributeTargets.Class)]
9-
public class CommandGroup : Attribute
10-
{
11-
}
1211
}
Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,42 @@
11
using Sora.Enumeration.EventParamsType;
22

3-
namespace Sora.Attributes.Command
3+
namespace Sora.Attributes.Command;
4+
5+
/// <summary>
6+
/// 群组指令
7+
/// </summary>
8+
public sealed class GroupCommand : RegexCommand
49
{
10+
#region 属性
11+
12+
/// <summary>
13+
/// <para>成员权限限制</para>
14+
/// <para>默认值:<see cref="MemberRoleType.Member"/></para>
15+
/// </summary>
16+
public MemberRoleType PermissionLevel { get; init; } = MemberRoleType.Member;
17+
18+
#endregion
19+
20+
#region 构造方法
21+
522
/// <summary>
6-
/// 群组指令
23+
/// 构造方法
724
/// </summary>
8-
public sealed class GroupCommand : RegexCommand
25+
/// <param name="command">
26+
/// <para>正则指令表达式</para>
27+
/// <para>默认为全字匹配(注意:由于使用的是正则匹配模式,部分符号需要转义,如<see langword="\?"/>)</para>
28+
/// <para>也可以为正则表达式</para>
29+
/// </param>
30+
public GroupCommand(string[] command) : base(command)
931
{
10-
#region 属性
11-
12-
/// <summary>
13-
/// <para>成员权限限制</para>
14-
/// <para>默认值:<see cref="MemberRoleType.Member"/></para>
15-
/// </summary>
16-
public MemberRoleType PermissionLevel { get; init; } = MemberRoleType.Member;
17-
18-
#endregion
19-
20-
#region 构造方法
21-
22-
/// <summary>
23-
/// 构造方法
24-
/// </summary>
25-
/// <param name="command">
26-
/// <para>正则指令表达式</para>
27-
/// <para>默认为全字匹配(注意:由于使用的是正则匹配模式,部分符号需要转义,如<see langword="\?"/>)</para>
28-
/// <para>也可以为正则表达式</para>
29-
/// </param>
30-
public GroupCommand(string[] command) : base(command)
31-
{
32-
}
33-
34-
/// <summary>
35-
/// 构造方法
36-
/// </summary>
37-
public GroupCommand()
38-
{
39-
}
40-
41-
#endregion
4232
}
33+
34+
/// <summary>
35+
/// 构造方法
36+
/// </summary>
37+
public GroupCommand()
38+
{
39+
}
40+
41+
#endregion
4342
}
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
namespace Sora.Attributes.Command
1+
namespace Sora.Attributes.Command;
2+
3+
/// <summary>
4+
/// 私聊指令
5+
/// </summary>
6+
public sealed class PrivateCommand : RegexCommand
27
{
38
/// <summary>
4-
/// 私聊指令
9+
/// 构造方法
510
/// </summary>
6-
public sealed class PrivateCommand : RegexCommand
11+
/// <param name="command">
12+
/// <para>正则指令表达式</para>
13+
/// <para>默认为全字匹配(注意:由于使用的是正则匹配模式,部分符号需要转义,如<see langword="\?"/>)</para>
14+
/// <para>也可以为正则表达式</para>
15+
/// </param>
16+
public PrivateCommand(string[] command) : base(command)
717
{
8-
/// <summary>
9-
/// 构造方法
10-
/// </summary>
11-
/// <param name="command">
12-
/// <para>正则指令表达式</para>
13-
/// <para>默认为全字匹配(注意:由于使用的是正则匹配模式,部分符号需要转义,如<see langword="\?"/>)</para>
14-
/// <para>也可以为正则表达式</para>
15-
/// </param>
16-
public PrivateCommand(string[] command) : base(command)
17-
{
18-
}
18+
}
1919

20-
/// <summary>
21-
/// 构造方法
22-
/// </summary>
23-
public PrivateCommand()
24-
{
25-
}
20+
/// <summary>
21+
/// 构造方法
22+
/// </summary>
23+
public PrivateCommand()
24+
{
2625
}
2726
}

0 commit comments

Comments
 (0)