Skip to content

Commit ee15495

Browse files
New Crowdin translations by GitHub Action (#167)
Co-authored-by: Crowdin Bot <[email protected]>
1 parent 26e36af commit ee15495

File tree

4 files changed

+82
-2
lines changed

4 files changed

+82
-2
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: 10. 模板初始化操作
3+
---
4+
5+
Natasha 的所有模板均继承自 ComplierTemplate ,ComplierTemplate 本身会提供静态构造方法。因此上层 API 也会被支持。Therefore, the upper-level API is also supported.因此上层 API 也会被支持。
6+
7+
<br/>
8+
9+
## 使用
10+
11+
NDelegate / NAssembly / NClass.. / xxx_Oerator 等等以下称为 “Handler”.
12+
13+
<br/>
14+
15+
#### 静态初始化代码:
16+
17+
```cs
18+
19+
//使用 domain 域
20+
Handler.UseDomain(domian, compiler => { 编译器配置 });
21+
22+
23+
//使用某编译器的域
24+
Handler.UseCompiler(assemblyCSharpCompiler, compiler => { 编译器配置 }));
25+
26+
27+
//创建一个 "domainJim" 域
28+
Handler.CreateDomain("domianJim", compiler => { 编译器配置 });
29+
30+
31+
//使用默认域
32+
Handler.DefaultDomain(compiler => { 编译器配置 });
33+
34+
35+
//使用随机域
36+
Handler.RandomDomain(compiler => { 编译器配置 });
37+
38+
```
39+
40+
<br/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
label: 'Quick start'
2+
label: '封装规范入门'
33
position: 100000 #float position is supported
44
collapsed: true #keep the category open by default
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: 10. 模板初始化操作
3+
---
4+
5+
Natasha 的所有模板均继承自 ComplierTemplate ,ComplierTemplate 本身会提供静态构造方法。因此上层 API 也会被支持。
6+
7+
<br/>
8+
9+
## 使用
10+
11+
NDelegate / NAssembly / NClass.. / xxx_Oerator 等等以下称为 “Handler”.
12+
13+
<br/>
14+
15+
#### 静态初始化代码:
16+
17+
```cs
18+
19+
//使用 domain 域
20+
Handler.UseDomain(domian, compiler => { 编译器配置 });
21+
22+
23+
//使用某编译器的域
24+
Handler.UseCompiler(assemblyCSharpCompiler, compiler => { 编译器配置 }));
25+
26+
27+
//创建一个 "domainJim" 域
28+
Handler.CreateDomain("domianJim", compiler => { 编译器配置 });
29+
30+
31+
//使用默认域
32+
Handler.DefaultDomain(compiler => { 编译器配置 });
33+
34+
35+
//使用随机域
36+
Handler.RandomDomain(compiler => { 编译器配置 });
37+
38+
```
39+
40+
<br/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
label: 'クイックスタート'
2+
label: '封装规范入门'
33
position: 100000 #float position is supported
44
collapsed: true #keep the category open by default

0 commit comments

Comments
 (0)