Skip to content

Commit 65eb5d1

Browse files
committed
Translate #region comment
1 parent 902800c commit 65eb5d1

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

src/Senparc.CO2NET.Cache.CsRedis.Tests/InitTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ namespace Senparc.CO2NET.Cache.CsRedis.Tests
1616
public class InitTests
1717
{
1818
/// <summary>
19-
/// 测试 Redis 连接字符串是否可以在 UseSenparcGlobal() 阶段立即生效
19+
/// Test whether the Redis connection string can take effect immediately during the UseSenparcGlobal() phase
2020
/// </summary>
2121
[TestMethod]
2222
public void AutoRegisterConfigurationTest()
2323
{
24-
// 执行常规注册
24+
// Perform regular registration
2525
var serviceCollection = new ServiceCollection();
2626
var configBuilder = new ConfigurationBuilder();
2727
var config = configBuilder.Build();
2828
serviceCollection.AddSenparcGlobalServices(config);
29-
serviceCollection.AddMemoryCache();// 使用内存缓存
29+
serviceCollection.AddMemoryCache();// Use memory cache
3030

3131
var mockEnv = new Mock<Microsoft.Extensions.Hosting.IHostEnvironment/*IHostingEnvironment*/>();
3232
mockEnv.Setup(z => z.ContentRootPath).Returns(() => UnitTestHelper.RootPath);
3333

34-
RedisManager.ConfigurationOption = null;// 测试前清除
34+
RedisManager.ConfigurationOption = null;// Clear before testing
3535

3636
var redisServer = "localhost:6379";
3737

@@ -45,11 +45,11 @@ public void AutoRegisterConfigurationTest()
4545
var registerService = Senparc.CO2NET.AspNet.RegisterServices.
4646
RegisterService.Start(mockEnv.Object, senparcSetting)
4747
.UseSenparcGlobal();
48-
Assert.AreEqual(null, RedisManager.ConfigurationOption);// 尚未注册
48+
Assert.AreEqual(null, RedisManager.ConfigurationOption);// Not registered yet
4949

5050
registerService.RegisterCacheRedis(
5151
redisServer,
52-
redisConfiguration => RedisObjectCacheStrategy.Instance// 第一次调用时将自动注册
52+
redisConfiguration => RedisObjectCacheStrategy.Instance// Will automatically register on the first call
5353
);
5454
Assert.AreEqual(redisServer, RedisManager.ConfigurationOption);
5555

src/Senparc.CO2NET.Cache.CsRedis/ObjectCacheStrategy/BaseRedisObjectCacheStrategy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static BaseRedisObjectCacheStrategy()
7676
}
7777

7878

79-
#region 同步方法
79+
#region Synchronous Methods
8080

8181

8282
[Obsolete("此方法已过期,请使用 Set(TKey key, TValue value) 方法", true)]
@@ -101,7 +101,7 @@ static BaseRedisObjectCacheStrategy()
101101

102102
#endregion
103103

104-
#region 异步方法
104+
#region Asynchronous Methods
105105

106106
public abstract Task SetAsync(string key, object value, TimeSpan? expiry = null, bool isFullKey = false);
107107

@@ -123,7 +123,7 @@ static BaseRedisObjectCacheStrategy()
123123
#endregion
124124

125125

126-
#region 同步锁
126+
#region Synchronous Lock
127127

128128
public override ICacheLock BeginCacheLock(string resourceName, string key, int retryCount = 0, TimeSpan retryDelay = new TimeSpan())
129129
{

src/Senparc.CO2NET.Cache.CsRedis/ObjectCacheStrategy/RedisObjectCacheStrategy.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace Senparc.CO2NET.Cache.CsRedis
6767
/// </summary>
6868
public class RedisObjectCacheStrategy : BaseRedisObjectCacheStrategy
6969
{
70-
#region 单例
70+
#region Singleton
7171

7272
/// <summary>
7373
/// Redis cache strategy
@@ -109,9 +109,9 @@ private int GetExpirySeconds(TimeSpan? expiry)
109109
}
110110

111111

112-
#region 实现 IBaseObjectCacheStrategy 接口
112+
#region Implement IBaseObjectCacheStrategy interface
113113

114-
#region 同步接口
114+
#region Synchronous interface
115115

116116
/// <summary>
117117
///
@@ -261,7 +261,7 @@ public override void Update(string key, object value, TimeSpan? expiry = null, b
261261
#endregion
262262

263263

264-
#region 异步方法
264+
#region Asynchronous methods
265265

266266
/// <summary>
267267
///

src/Senparc.CO2NET.Cache.CsRedis/RedisCacheLock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected RedisCacheLock(BaseRedisObjectCacheStrategy strategy, string resourceN
5555
//LockNow();//Immediately wait and seize the lock
5656
}
5757

58-
#region 同步方法
58+
#region Synchronous Methods
5959

6060
/// <summary>
6161
/// Create a RedisCacheLock instance and immediately attempt to acquire the lock
@@ -97,7 +97,7 @@ public override void UnLock()
9797

9898
#endregion
9999

100-
#region 异步方法
100+
#region Asynchronous Methods
101101

102102
/// <summary>
103103
/// [Asynchronous method] Create a RedisCacheLock instance and immediately attempt to acquire the lock

src/Senparc.CO2NET.Cache.Redis/RedisCacheLock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected RedisCacheLock(BaseRedisObjectCacheStrategy strategy, string resourceN
5555
//LockNow();//Immediately wait and acquire the lock
5656
}
5757

58-
#region 同步方法
58+
#region Synchronous Methods
5959

6060
/// <summary>
6161
/// Create an instance of RedisCacheLock and immediately attempt to acquire the lock
@@ -97,7 +97,7 @@ public override void UnLock()
9797

9898
#endregion
9999

100-
#region 异步方法
100+
#region Asynchronous Methods
101101

102102
/// <summary>
103103
/// [Asynchronous method] Create an instance of RedisCacheLock and immediately attempt to acquire the lock

src/Senparc.CO2NET.WebApi/WebApiEngines/WebApiEngine.Doc.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace Senparc.CO2NET.WebApi
2727
{
2828
public partial class WebApiEngine
2929
{
30-
#region Doc 文档相关
30+
#region Doc related
3131

3232
/// <summary>
3333
/// Get global unified docName
@@ -179,7 +179,7 @@ private async Task<ApiXmlInfo> TryGetApiXmlInfo(string category, string sourceAs
179179
ApiXmlInfo apiXmlInfo;
180180
if (!sourceApiXmlCollection.ContainsKey(sourceAssemblyName))
181181
{
182-
#region 使用内嵌资源
182+
#region Using embedded resources
183183
//var sourceName = $"Senparc.Xncf.WeixinManager.App_Data.ApiDocXml.{xmlFileName}";//Embedded resource address
184184
//var sourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(sourceName);
185185
//var useXml = sourceStream?.Length > 0;
@@ -311,7 +311,7 @@ internal void SaveDynamicApiXml()
311311

312312
foreach (var item in dynamicApiXmlCollection)
313313
{
314-
#region 保存新的 Xml 文件
314+
#region Save new Xml file
315315

316316

317317
var newDocFileName = Path.Combine(dynamicFilePath, $"{item.Key}.xml");

src/Senparc.CO2NET.WebApi/WebApiEngines/WebApiEngine.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ internal void WriteLog(string msg, bool hideLog = false)
9696
}
9797
}
9898

99-
#region 创建动态程序集相关
99+
#region Create dynamic assembly related
100100

101101

102102
/// <summary>
@@ -123,7 +123,7 @@ public async Task<int> BuildWebApi(IGrouping<string, KeyValuePair<string, ApiBin
123123

124124
var assembleName = ApiAssemblyNames[category];
125125

126-
#region 动态创建程序集
126+
#region Dynamically create assembly
127127

128128
var dynamicAssembly = BuildDynamicAssembly(assembleName, apiBindGroup);
129129

@@ -188,7 +188,7 @@ public async Task<int> BuildWebApi(IGrouping<string, KeyValuePair<string, ApiBin
188188

189189
apiIndex++;
190190

191-
#region 创建 API 方法
191+
#region Create API methods
192192

193193
await BuildApiMethodForOneThread(apiBindGroup, apiBindInfoBlock, apiMethodName, dynamicAssembly.ControllerKeyName, dynamicAssembly.Tb,
194194
dynamicAssembly.FbServiceProvider, apiIndex);

src/Senparc.CO2NET/SenparcSetting.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class SenparcSetting
3737
public string SenparcUnionAgentKey { get; set; }
3838

3939

40-
#region 分布式缓存
40+
#region Distributed Cache
4141

4242
/// <summary>
4343
/// Redis connection string

0 commit comments

Comments
 (0)