From 651b738130685fd305e7960fb4562cb912812eb5 Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Wed, 15 Apr 2015 16:55:17 -0700 Subject: [PATCH] changed some error message and cleaned up code --- .../AbstractCodeGenerationService.cs | 14 +++++++------- .../Core/Portable/WorkspacesResources.Designer.cs | 6 +++--- .../Core/Portable/WorkspacesResources.resx | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs b/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs index f9d2e389d4d..d1298571189 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs @@ -98,14 +98,14 @@ protected static T Cast(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(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(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(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(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(object value) throw new ArgumentException( string.Format(WorkspacesResources.InvalidDestinationNode3, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name), - "destination"); + nameof(destination)); } } diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs b/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs index 4086f5b008c..1e818d7d80c 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs +++ b/src/Workspaces/Core/Portable/WorkspacesResources.Designer.cs @@ -467,7 +467,7 @@ internal class WorkspacesResources { } /// - /// 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}.. /// internal static string InvalidDestinationNode { get { @@ -476,7 +476,7 @@ internal class WorkspacesResources { } /// - /// 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}.. /// internal static string InvalidDestinationNode2 { get { @@ -485,7 +485,7 @@ internal class WorkspacesResources { } /// - /// 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}.. /// internal static string InvalidDestinationNode3 { get { diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx index e584e43add7..c3cc29f97e9 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.resx +++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx @@ -130,13 +130,13 @@ Cycle detected in extensions - Destination type must be a {0}. but given one is {1}. + Destination type must be a {0}, but given one is {1}. - Destination type must be a {0} or a {1}. but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0}, {1} or {2}. but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. Could not find location to generation symbol into. -- GitLab