XFEExtension
【DLL】XFE各类拓展是一个C#的DLL库,旨在优化C#代码中常用语句的使用,并提供更简洁的访问方式,同时提供Xunit测试框架,快速搭建服务器/客户端,免费ChatGPTAPI接口,免费通讯服务器,XFE下载器,新增格式等
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFE各类拓展.NetCore.Analyzer.Test/SystemProfile.cs
+1
-1
Modified
XFE各类拓展.NetCore.Analyzer/ProfilePropertyAutoGenerator.cs
+3
-3
Modified
XFE各类拓展.NetCore/ProfileExtension/AutoLoadProfileAttribute.cs
+1
-1
Modified
XFE各类拓展.NetCore/ProfileExtension/ProfilePropertyAddGetAttribute.cs
+1
-1
Modified
XFE各类拓展.NetCore/ProfileExtension/ProfilePropertyAddSetAttribute.cs
+1
-1
XFEstudio/XFEExtension
修复部分bug,现在可以正常识别字段的注释并将其添加到属性上
fe9340c
代码差异
5 个文件
+7
-7
@@ -2,7 +2,7 @@
2
2
3
3
namespace XFE各类拓展.NetCore.Analyzer.Test;
4
4
5
[AutoLoadProfile]
5
[AutoLoadProfile(false)]
6
6
public static partial class SystemProfile
7
7
{
8
8
[ProfileProperty]
@@ -107,7 +107,8 @@ namespace XFE各类拓展.NetCore.Analyzer
107
107
.WithBody(SyntaxFactory.Block(getExpressionStatements)),
108
108
SyntaxFactory.AccessorDeclaration(SyntaxKind.SetAccessorDeclaration)
109
109
.WithBody(SyntaxFactory.Block(setExpressionStatements))
110
})));
110
})))
111
.WithLeadingTrivia(fieldDeclarationSyntax.GetLeadingTrivia());
111
112
return property.NormalizeWhitespace();
112
113
});
113
114
var profileClassSyntaxTree = GenerateProfileClassSyntaxTree(classDeclaration, usingDirectives, properties, fileScopedNamespaceDeclarationSyntax);
@@ -134,8 +135,7 @@ namespace XFE各类拓展.NetCore.Analyzer
134
135
var staticConstructorSyntax = SyntaxFactory.ConstructorDeclaration(className)
135
136
.AddModifiers(SyntaxFactory.Token(SyntaxKind.StaticKeyword))
136
137
.WithBody(SyntaxFactory.Block(
137
SyntaxFactory.ParseStatement($"_ = global::XFE各类拓展.NetCore.ProfileExtension.XFEProfile.LoadProfiles(typeof({className}));")))
138
.NormalizeWhitespace();
138
SyntaxFactory.ParseStatement($"_ = global::XFE各类拓展.NetCore.ProfileExtension.XFEProfile.LoadProfiles(typeof({className}));")));
139
139
if (classDeclaration.AttributeLists.Any(IsAutoLoadProfileAttribute))
140
140
{
141
141
var autoLoadProfileAttribute = classDeclaration.AttributeLists.First(attributeList => IsAutoLoadProfileAttribute(attributeList)).Attributes.First();
@@ -10,5 +10,5 @@ public class AutoLoadProfileAttribute(bool autoLoad = true) : Attribute
10
10
/// <summary>
11
11
/// 是否自动加载
12
12
/// </summary>
13
public bool AutoLoad { get; set; } = autoLoad;
13
internal bool AutoLoad { get; set; } = autoLoad;
14
14
}
@@ -10,5 +10,5 @@ public class ProfilePropertyAddGetAttribute(string funcString) : Attribute
10
10
/// <summary>
11
11
/// 需要添加的代码
12
12
/// </summary>
13
public string FuncString { get; set; } = funcString;
13
internal string FuncString { get; set; } = funcString;
14
14
}
@@ -10,5 +10,5 @@ public class ProfilePropertyAddSetAttribute(string funcString) : Attribute
10
10
/// <summary>
11
11
/// 需要添加的代码
12
12
/// </summary>
13
public string FuncString { get; set; } = funcString;
13
internal string FuncString { get; set; } = funcString;
14
14
}