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

changed some error message and cleaned up code

上级 1754008c
...@@ -98,14 +98,14 @@ protected static T Cast<T>(object value) ...@@ -98,14 +98,14 @@ protected static T Cast<T>(object value)
{ {
if (destination == null) if (destination == null)
{ {
throw new ArgumentNullException("destination"); throw new ArgumentNullException(nameof(destination));
} }
if (!(destination is TDeclarationNode)) if (!(destination is TDeclarationNode))
{ {
throw new ArgumentException( throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode, typeof(TDeclarationNode).Name, destination.GetType().Name), string.Format(WorkspacesResources.InvalidDestinationNode, typeof(TDeclarationNode).Name, destination.GetType().Name),
"destination"); nameof(destination));
} }
} }
...@@ -115,7 +115,7 @@ protected static T Cast<T>(object value) ...@@ -115,7 +115,7 @@ protected static T Cast<T>(object value)
{ {
if (destination == null) if (destination == null)
{ {
throw new ArgumentNullException("destination"); throw new ArgumentNullException(nameof(destination));
} }
if (!(destination is TDeclarationNode1) && if (!(destination is TDeclarationNode1) &&
...@@ -124,7 +124,7 @@ protected static T Cast<T>(object value) ...@@ -124,7 +124,7 @@ protected static T Cast<T>(object value)
throw new ArgumentException( throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode2, string.Format(WorkspacesResources.InvalidDestinationNode2,
typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name), typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name),
"destination"); nameof(destination));
} }
} }
...@@ -135,7 +135,7 @@ protected static T Cast<T>(object value) ...@@ -135,7 +135,7 @@ protected static T Cast<T>(object value)
{ {
if (destination == null) if (destination == null)
{ {
throw new ArgumentNullException("destination"); throw new ArgumentNullException(nameof(destination));
} }
if (!(destination is TDeclarationNode1) && if (!(destination is TDeclarationNode1) &&
...@@ -145,7 +145,7 @@ protected static T Cast<T>(object value) ...@@ -145,7 +145,7 @@ protected static T Cast<T>(object value)
throw new ArgumentException( throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode3, string.Format(WorkspacesResources.InvalidDestinationNode3,
typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, destination.GetType().Name), 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) ...@@ -163,7 +163,7 @@ protected static T Cast<T>(object value)
throw new ArgumentException( throw new ArgumentException(
string.Format(WorkspacesResources.InvalidDestinationNode3, string.Format(WorkspacesResources.InvalidDestinationNode3,
typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name), typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name),
"destination"); nameof(destination));
} }
} }
......
...@@ -467,7 +467,7 @@ internal class WorkspacesResources { ...@@ -467,7 +467,7 @@ internal class WorkspacesResources {
} }
/// <summary> /// <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> /// </summary>
internal static string InvalidDestinationNode { internal static string InvalidDestinationNode {
get { get {
...@@ -476,7 +476,7 @@ internal class WorkspacesResources { ...@@ -476,7 +476,7 @@ internal class WorkspacesResources {
} }
/// <summary> /// <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> /// </summary>
internal static string InvalidDestinationNode2 { internal static string InvalidDestinationNode2 {
get { get {
...@@ -485,7 +485,7 @@ internal class WorkspacesResources { ...@@ -485,7 +485,7 @@ internal class WorkspacesResources {
} }
/// <summary> /// <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> /// </summary>
internal static string InvalidDestinationNode3 { internal static string InvalidDestinationNode3 {
get { get {
......
...@@ -130,13 +130,13 @@ ...@@ -130,13 +130,13 @@
<value>Cycle detected in extensions</value> <value>Cycle detected in extensions</value>
</data> </data>
<data name="InvalidDestinationNode" xml:space="preserve"> <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>
<data name="InvalidDestinationNode2" xml:space="preserve"> <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>
<data name="InvalidDestinationNode3" xml:space="preserve"> <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>
<data name="CouldNotFindLocationToGen" xml:space="preserve"> <data name="CouldNotFindLocationToGen" xml:space="preserve">
<value>Could not find location to generation symbol into.</value> <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.
先完成此消息的编辑!
想要评论请 注册