提交 651b7381 编写于 作者: H Heejae Chang

changed some error message and cleaned up code

上级 1754008c
......@@ -98,14 +98,14 @@ protected static T Cast<T>(object value)
{
if (destination == null)
{
throw new ArgumentNullException("destination");
throw new ArgumentNullException(nameof(destination));
}
if (!(destination is TDeclarationNode))
{
throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode, typeof(TDeclarationNode).Name, destination.GetType().Name),
"destination");
nameof(destination));
}
}
......@@ -115,7 +115,7 @@ protected static T Cast<T>(object value)
{
if (destination == null)
{
throw new ArgumentNullException("destination");
throw new ArgumentNullException(nameof(destination));
}
if (!(destination is TDeclarationNode1) &&
......@@ -124,7 +124,7 @@ protected static T Cast<T>(object value)
throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode2,
typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name),
"destination");
nameof(destination));
}
}
......@@ -135,7 +135,7 @@ protected static T Cast<T>(object value)
{
if (destination == null)
{
throw new ArgumentNullException("destination");
throw new ArgumentNullException(nameof(destination));
}
if (!(destination is TDeclarationNode1) &&
......@@ -145,7 +145,7 @@ protected static T Cast<T>(object value)
throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode3,
typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, destination.GetType().Name),
"destination");
nameof(destination));
}
}
......@@ -163,7 +163,7 @@ protected static T Cast<T>(object value)
throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode3,
typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name),
"destination");
nameof(destination));
}
}
......
......@@ -467,7 +467,7 @@ internal class WorkspacesResources {
}
/// <summary>
/// Looks up a localized string similar to Destination type must be a {0}. but given one is {1}..
/// Looks up a localized string similar to Destination type must be a {0}, but given one is {1}..
/// </summary>
internal static string InvalidDestinationNode {
get {
......@@ -476,7 +476,7 @@ internal class WorkspacesResources {
}
/// <summary>
/// Looks up a localized string similar to Destination type must be a {0} or a {1}. but given one is {2}..
/// Looks up a localized string similar to Destination type must be a {0} or a {1}, but given one is {2}..
/// </summary>
internal static string InvalidDestinationNode2 {
get {
......@@ -485,7 +485,7 @@ internal class WorkspacesResources {
}
/// <summary>
/// Looks up a localized string similar to Destination type must be a {0}, {1} or {2}. but given one is {3}..
/// Looks up a localized string similar to Destination type must be a {0}, {1} or {2}, but given one is {3}..
/// </summary>
internal static string InvalidDestinationNode3 {
get {
......
......@@ -130,13 +130,13 @@
<value>Cycle detected in extensions</value>
</data>
<data name="InvalidDestinationNode" xml:space="preserve">
<value>Destination type must be a {0}. but given one is {1}.</value>
<value>Destination type must be a {0}, but given one is {1}.</value>
</data>
<data name="InvalidDestinationNode2" xml:space="preserve">
<value>Destination type must be a {0} or a {1}. but given one is {2}.</value>
<value>Destination type must be a {0} or a {1}, but given one is {2}.</value>
</data>
<data name="InvalidDestinationNode3" xml:space="preserve">
<value>Destination type must be a {0}, {1} or {2}. but given one is {3}.</value>
<value>Destination type must be a {0}, {1} or {2}, but given one is {3}.</value>
</data>
<data name="CouldNotFindLocationToGen" xml:space="preserve">
<value>Could not find location to generation symbol into.</value>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册