Skip to content

Commit

Permalink
#### 3.0.2.4
Browse files Browse the repository at this point in the history
* 优化 - 修改部分异常提示。
  • Loading branch information
GuQiangJS committed Aug 4, 2017
1 parent 33e8fa6 commit 40b5c93
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
@@ -1,3 +1,7 @@
#### 3.0.2.4

* 优化 - 修改部分异常提示。

#### 3.0.2.3

* 重构 - 重构 `XmlTextReader`。使用 `XmlReader`作为读取器。
Expand Down
15 changes: 15 additions & 0 deletions src/XPatchLib/LocalizationRes.cs
Expand Up @@ -44,5 +44,20 @@ internal static string Exp_String_KeyValue_KeyIsNull
{
get { return "Exp_String_KeyValue_KeyIsNull"; }
}

internal static string Exp_String_InvalidIndentation
{
get { return "Exp_String_InvalidIndentation"; }
}

internal static string Exp_String_InvalidQuote
{
get { return "Exp_String_InvalidQuote"; }
}

internal static string Exp_String_WriteClosed
{
get { return "Exp_String_WriteClosed"; }
}
}
}
9 changes: 9 additions & 0 deletions src/XPatchLib/Properties/LocalizationRes.resx
Expand Up @@ -123,6 +123,12 @@
<data name="Exp_String_FileNotExists" xml:space="preserve">
<value>文件 '{0}' 不存在。</value>
</data>
<data name="Exp_String_InvalidIndentation" xml:space="preserve">
<value>缩进值必须大于0。</value>
</data>
<data name="Exp_String_InvalidQuote" xml:space="preserve">
<value>XML属性引用字符无效。 有效的属性引号字符是 ' 和 "。</value>
</data>
<data name="Exp_String_IsNotColor" xml:space="preserve">
<value>'{0}' 不能被转换成 System.Drawing.Color 对象。</value>
</data>
Expand All @@ -141,4 +147,7 @@
<data name="Exp_String_PrimaryKey" xml:space="preserve">
<value>'{0}' 的 主键 '{1}' 设置异常。</value>
</data>
<data name="Exp_String_WriteClosed" xml:space="preserve">
<value>写入器被关闭。</value>
</data>
</root>
4 changes: 2 additions & 2 deletions src/XPatchLib/XPatchLib.csproj
Expand Up @@ -11,8 +11,8 @@
<Description>Patch Serialization Library for the .Net</Description>
<Company />
<Authors>Qiang Gu</Authors>
<FileVersion>3.0.2.3</FileVersion>
<VersionPrefix>3.0.2.3</VersionPrefix>
<FileVersion>3.0.2.4</FileVersion>
<VersionPrefix>3.0.2.4</VersionPrefix>
<VersionSuffix Condition="'$(Configuration)'=='Debug'">DEBUG</VersionSuffix>
<PackageLicenseUrl>https://github.com/GuQiangJS/XPatchLib.Net/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/GuQiangJS/XPatchLib.Net</PackageProjectUrl>
Expand Down
1 change: 0 additions & 1 deletion src/XPatchLib/XmlTextReader.cs
Expand Up @@ -192,7 +192,6 @@ public bool Read()
return true;
}
}
return true;
}

private void SetXmlReaderNormalization()
Expand Down
8 changes: 5 additions & 3 deletions src/XPatchLib/XmlTextWriter.cs
Expand Up @@ -203,13 +203,14 @@ public Formatting Formatting
/// <see cref="ITextWriter.IndentChar" />。
/// </summary>
/// <value>每个级别的 <see cref="ITextWriter.IndentChar" /> 的数目。默认值为 2。</value>
/// <exception cref="ArgumentException">当设置值小于等于0时。</exception>
public int Indentation
{
get { return _indentation; }
set
{
if (value < 0)
throw new ArgumentException( /*Res.GetString(Res.Xml_InvalidIndentation)*/);
throw new ArgumentException(ResourceHelper.GetResourceString(LocalizationRes.Exp_String_InvalidIndentation));
_indentation = value;
}
}
Expand All @@ -232,13 +233,14 @@ public char IndentChar
/// 获取或设置哪个字符用于将属性值引起来。
/// </summary>
/// <value>用于将属性值引起来的字符。这必须是单引号 (&#39;) 或双引号 (&#34;)。默认为双引号。</value>
/// <exception cref="ArgumentException">当设定字符串不是 <c>'</c> 及 <c>"</c> 时。</exception>
public char QuoteChar
{
get { return _quoteChar; }
set
{
if (value != '"' && value != '\'')
throw new ArgumentException( /*Res.GetString(Res.Xml_InvalidQuote)*/);
throw new ArgumentException(ResourceHelper.GetResourceString(LocalizationRes.Exp_String_InvalidQuote));
_quoteChar = value;
}
}
Expand Down Expand Up @@ -279,7 +281,7 @@ private void WriteEndStartTag(bool empty)
private void AutoComplete(Token token)
{
if (_currentState == State.Closed)
throw new InvalidOperationException( /*Res.GetString(Res.Xml_Closed)*/);
throw new InvalidOperationException(ResourceHelper.GetResourceString(LocalizationRes.Exp_String_WriteClosed));
if (_currentState == State.Error)
throw new InvalidOperationException(
/*Res.GetString(Res.Xml_WrongToken, tokenName[(int)token], stateName[(int)State.Error])*/);
Expand Down

0 comments on commit 40b5c93

Please sign in to comment.