Skip to content

Commit 10d53a5

Browse files
committed
fix MiniWorHyperLink to MiniWordHyperLink
1 parent 7397713 commit 10d53a5

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,27 @@ var value = new { title = "Hello MiniWord" };
193193
MiniWord.SaveAsByTemplate(outputPath, templatePath, value);
194194
```
195195

196-
### Font ForeColor and BackColor functions
196+
### HyperLink
197+
198+
If value type is `MiniWordHyperLink` system will replace template string by hyperlink.
199+
200+
* Url: HyperLink URI target path
201+
* Text:Description
202+
197203
```csharp
198-
var value = new
199-
{
200-
Company_Name = new MiniWordColorText { Text = "MiniSofteware", ForeColor = "#eb70AB" },
201-
Name = new MiniWordColorText { Text = "Jack", BackColor = "#eb70AB" },
202-
CreateDate = new MiniWordColorText { Text = new DateTime(2021, 01, 01).ToString(), BackColor = "#eb70AB", ForeColor = "#ffffff" },
203-
204-
VIP = true,
205-
Points = 123,
206-
APP = "Demo APP",
207-
};
204+
var value = new
205+
{
206+
["Name"] = new MiniWordHyperLink(){
207+
Url = "https://google.com",
208+
Text = "Test Link!!"
209+
},
210+
["Company_Name"] = "MiniSofteware",
211+
["CreateDate"] = new DateTime(2021, 01, 01),
212+
["VIP"] = true,
213+
["Points"] = 123,
214+
["APP"] = "Demo APP",
215+
};
216+
MiniWord.SaveAsByTemplate(path, templatePath, value);
208217
```
209218

210219

README.zh-CN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,17 @@ MiniWord.SaveAsByTemplate(outputPath, templatePath, value);
202202

203203
### HyperLink
204204

205-
我们可以尝试使用 `MiniWorHyperLink` 类,用模板测试替换为超链接。
205+
我们可以尝试使用 `MiniWodrHyperLink` 类,用模板测试替换为超链接。
206206

207-
`MiniWorHyperLink` 提供了两个主要参数。
207+
`MiniWordHyperLink` 提供了两个主要参数。
208208

209209
* Url: HyperLink URI 目标路径
210210
* 文字:超链接文字
211211

212212
```csharp
213213
var value = new
214214
{
215-
["Name"] = new MiniWorHyperLink(){
215+
["Name"] = new MiniWordHyperLink(){
216216
Url = "https://google.com",
217217
Text = "測試連結!!"
218218
},

README.zh-Hant.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,17 @@ MiniWord.SaveAsByTemplate(outputPath, templatePath, value);
200200

201201
### HyperLink
202202

203-
我們可以嘗試使用 `MiniWorHyperLink` 類,它將模板文本替換為超鏈接。
203+
我們可以嘗試使用 `MiniWordHyperLink` 類,它將模板文本替換為超鏈接。
204204

205-
`MiniWorHyperLink` 提供了兩個主要參數。
205+
`MiniWordHyperLink` 提供了兩個主要參數。
206206

207207
* Url: HyperLink URI 目標路徑
208208
* 文字:超鏈接文字
209209

210210
```csharp
211211
var value = new
212212
{
213-
["Name"] = new MiniWorHyperLink(){
213+
["Name"] = new MiniWordHyperLink(){
214214
Url = "https://google.com",
215215
Text = "測試連結!!"
216216
},
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ namespace MiniSoftware
33
using DocumentFormat.OpenXml.Wordprocessing;
44
using MiniSoftware.Utility;
55

6-
public class MiniWorHyperLink{
6+
public class MiniWordHyperLink
7+
{
78
public string Url { get; set; }
89

910
public string Text { get; set; }
@@ -12,8 +13,9 @@ public class MiniWorHyperLink{
1213

1314
public TargetFrameType TargetFrame { get; set; } = TargetFrameType.Blank;
1415

15-
internal string GetTargetFrame(){
16-
16+
internal string GetTargetFrame()
17+
{
18+
1719
switch (TargetFrame)
1820
{
1921
case TargetFrameType.Blank:

0 commit comments

Comments
 (0)