Skip to content

Commit bcb38d6

Browse files
committed
修改编码
1 parent 44f2f1a commit bcb38d6

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

EncodingNormalizerVsx/Model/EncodingScrutatorFile.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.IO;
1+
using System.IO;
22
using System.Text;
33

44
namespace EncodingNormalizerVsx.Model
@@ -23,7 +23,7 @@ public void WriteSitpulationEncoding(Encoding encoding)
2323
{
2424
if (Encoding == System.Text.Encoding.ASCII.EncodingName)
2525
{
26-
//²»ÐÞ¸Äascii
26+
//不修改ascii
2727
if ( Equals(encoding, System.Text.Encoding.UTF8) ||
2828
Equals(encoding, System.Text.Encoding.GetEncoding("GBK"))||
2929
Equals(encoding, System.Text.Encoding.ASCII))
@@ -44,7 +44,7 @@ public void WriteSitpulationEncoding(Encoding encoding)
4444
}
4545

4646
/// <summary>
47-
/// »ñȡȫÃû³Æ
47+
/// 获取全名称
4848
/// </summary>
4949
public string GetEncodingScrutatorFileDirectory()
5050
{

EncodingNormalizerVsx/Model/WriteFolderEncoding.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
@@ -8,7 +8,7 @@ namespace EncodingNormalizerVsx.Model
88
public class WriteFolderEncoding
99
{
1010
/// <summary>
11-
/// 把所有的文件写编码规范
11+
/// 把所有的文件写编码规范
1212
/// </summary>
1313
public void WriteSitpulationEncoding(IEnumerable<IEncodingScrutatorFile> encodingScrutatorFolder,
1414
EncodingScrutatorProgress progress, Encoding encoding)

EncodingNormalizerVsx/ViewModel/DefinitionModel.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
@@ -9,24 +9,24 @@
99
namespace EncodingNormalizerVsx.ViewModel
1010
{
1111
/// <summary>
12-
/// 定义用户设置
12+
/// 定义用户设置
1313
/// </summary>
1414
public class DefinitionModel : NotifyProperty
1515
{
1616
/// <summary>
17-
/// 保存用户设置文件夹
17+
/// 保存用户设置文件夹
1818
/// </summary>
1919
private static readonly string _folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\EncodingNormalizer\\";
2020
/// <summary>
21-
/// 保存用户设置文件
21+
/// 保存用户设置文件
2222
/// </summary>
2323
private static readonly string _file = _folder + "Account.json";
2424

2525
private Account _account;
2626

2727
public DefinitionModel()
2828
{
29-
//一定会读
29+
//一定会读
3030
if (Account == null)
3131
{
3232
ReadAccount();
@@ -38,12 +38,12 @@ public DefinitionModel()
3838
OptionCriterionEncoding.Add(temp);
3939
}
4040

41-
//获取之前的编码
41+
//获取之前的编码
4242
CriterionEncoding = OptionCriterionEncoding.First(temp => temp.Equals(Account.CriterionEncoding.ToString()));
4343
}
4444

4545
/// <summary>
46-
/// 可选的编码
46+
/// 可选的编码
4747
/// </summary>
4848
public List<string> OptionCriterionEncoding { set; get; }
4949

@@ -62,7 +62,7 @@ public string CriterionEncoding
6262
}
6363
}
6464
/// <summary>
65-
/// 用户设置
65+
/// 用户设置
6666
/// </summary>
6767
public Account Account
6868
{
@@ -75,7 +75,7 @@ public Account Account
7575
}
7676

7777
/// <summary>
78-
/// 读取设置
78+
/// 读取设置
7979
/// </summary>
8080
private void ReadAccount()
8181
{
@@ -84,7 +84,7 @@ private void ReadAccount()
8484

8585

8686
/// <summary>
87-
/// 写入用户设置
87+
/// 写入用户设置
8888
/// </summary>
8989
public bool WriteAccount()
9090
{
@@ -96,10 +96,10 @@ public bool WriteAccount()
9696
}
9797
//Account.FileInclude
9898

99-
//检查白名单
99+
//检查白名单
100100
//if (!)
101101
//{
102-
// MessageBox.Show("不支持指定文件夹中的文件", "白名单格式错误");
102+
// MessageBox.Show("不支持指定文件夹中的文件", "白名单格式错误");
103103
// return false;
104104
//}
105105
if (!ConformWhiteList())
@@ -135,10 +135,10 @@ private bool ConformFileInclude()
135135
};
136136
foreach (var temp in Account.FileInclude.Split('\n').Select(temp => temp.Replace("\r", "")).ToList())
137137
{
138-
//不能包含格式
138+
//不能包含格式
139139
if (illegalFile.Any(temp.Contains))
140140
{
141-
MessageBox.Show("出现文件不能包含字符 \r\n第一处错误在 "+ temp, "包含文件格式错误");
141+
MessageBox.Show("出现文件不能包含字符 \r\n第一处错误在 "+ temp, "包含文件格式错误");
142142
return false;
143143
}
144144
}
@@ -148,7 +148,7 @@ private bool ConformFileInclude()
148148
}
149149
catch (Exception e)
150150
{
151-
MessageBox.Show(e.Message, "包含文件格式错误");
151+
MessageBox.Show(e.Message, "包含文件格式错误");
152152
return false;
153153
}
154154
return true;
@@ -162,7 +162,7 @@ private bool ConformWhiteList()
162162
}
163163
catch (Exception e)
164164
{
165-
MessageBox.Show(e.Message, "白名单格式错误");
165+
MessageBox.Show(e.Message, "白名单格式错误");
166166
return false;
167167
}
168168
return true;

0 commit comments

Comments
 (0)