From 84ec20d2aed86b27eb8791b24550ba0a9a790c0d Mon Sep 17 00:00:00 2001 From: Raymond Martin Date: Wed, 19 Apr 2017 11:08:45 -0700 Subject: [PATCH] Fix for srGen designer issues (#321) * removing designer files * adding designer files to gitignore * updating refs and tests --- .gitignore | 3 + .../Localization/sr.Designer.cs | 107 -- .../Localization/sr.Designer.cs | 197 ---- .../Properties/AssemblyInfo.cs | 4 + .../Localization/sr.Designer.cs | 962 ------------------ .../ObjectExplorer/Nodes/TreeNode.cs | 35 +- .../ObjectExplorer/ObjectExplorerService.cs | 74 +- .../SmoModel/SmoQueryContext.cs | 6 +- .../ObjectExplorer/SmoModel/SmoQueryModel.cs | 30 +- .../SmoModel/TreeNodeGenerator.cs | 22 +- .../Utility/SrTests.cs | 58 +- 11 files changed, 110 insertions(+), 1388 deletions(-) delete mode 100644 src/Microsoft.SqlTools.Credentials/Localization/sr.Designer.cs delete mode 100644 src/Microsoft.SqlTools.Hosting/Localization/sr.Designer.cs delete mode 100644 src/Microsoft.SqlTools.ServiceLayer/Localization/sr.Designer.cs diff --git a/.gitignore b/.gitignore index 9e83edea..c4076589 100644 --- a/.gitignore +++ b/.gitignore @@ -294,3 +294,6 @@ docs/metadata # Test output files *cycle*txt* *input*txt* + +# Designer Files +*.Designer.cs \ No newline at end of file diff --git a/src/Microsoft.SqlTools.Credentials/Localization/sr.Designer.cs b/src/Microsoft.SqlTools.Credentials/Localization/sr.Designer.cs deleted file mode 100644 index 58451df3..00000000 --- a/src/Microsoft.SqlTools.Credentials/Localization/sr.Designer.cs +++ /dev/null @@ -1,107 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.SqlTools.Credentials.Localization { - using System; - using System.Reflection; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class sr { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - internal sr() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.SqlTools.Credentials.Localization.sr", typeof(sr).GetTypeInfo().Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Win32Credential object is already disposed. - /// - public static string CredentialServiceWin32CredentialDisposed { - get { - return ResourceManager.GetString("CredentialServiceWin32CredentialDisposed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid CriticalHandle!. - /// - public static string CredentialsServiceInvalidCriticalHandle { - get { - return ResourceManager.GetString("CredentialsServiceInvalidCriticalHandle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The password has exceeded 512 bytes. - /// - public static string CredentialsServicePasswordLengthExceeded { - get { - return ResourceManager.GetString("CredentialsServicePasswordLengthExceeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to delete a credential. - /// - public static string CredentialsServiceTargetForDelete { - get { - return ResourceManager.GetString("CredentialsServiceTargetForDelete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to check existance of a credential. - /// - public static string CredentialsServiceTargetForLookup { - get { - return ResourceManager.GetString("CredentialsServiceTargetForLookup", resourceCulture); - } - } - } -} diff --git a/src/Microsoft.SqlTools.Hosting/Localization/sr.Designer.cs b/src/Microsoft.SqlTools.Hosting/Localization/sr.Designer.cs deleted file mode 100644 index f10c6680..00000000 --- a/src/Microsoft.SqlTools.Hosting/Localization/sr.Designer.cs +++ /dev/null @@ -1,197 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.SqlTools.Hosting.Localization { - using System; - using System.Reflection; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class sr { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - internal sr() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.SqlTools.Hosting.Localization.sr", typeof(sr).GetTypeInfo().Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Win32Credential object is already disposed. - /// - public static string CredentialServiceWin32CredentialDisposed { - get { - return ResourceManager.GetString("CredentialServiceWin32CredentialDisposed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid CriticalHandle!. - /// - public static string CredentialsServiceInvalidCriticalHandle { - get { - return ResourceManager.GetString("CredentialsServiceInvalidCriticalHandle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The password has exceeded 512 bytes. - /// - public static string CredentialsServicePasswordLengthExceeded { - get { - return ResourceManager.GetString("CredentialsServicePasswordLengthExceeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to delete a credential. - /// - public static string CredentialsServiceTargetForDelete { - get { - return ResourceManager.GetString("CredentialsServiceTargetForDelete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to check existance of a credential. - /// - public static string CredentialsServiceTargetForLookup { - get { - return ResourceManager.GetString("CredentialsServiceTargetForLookup", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Message header must separate key and value using ':'. - /// - public static string HostingHeaderMissingColon { - get { - return ResourceManager.GetString("HostingHeaderMissingColon", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fatal error: Content-Length header must be provided. - /// - public static string HostingHeaderMissingContentLengthHeader { - get { - return ResourceManager.GetString("HostingHeaderMissingContentLengthHeader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fatal error: Content-Length value is not an integer. - /// - public static string HostingHeaderMissingContentLengthValue { - get { - return ResourceManager.GetString("HostingHeaderMissingContentLengthValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MessageReader's input stream ended unexpectedly, terminating. - /// - public static string HostingUnexpectedEndOfStream { - get { - return ResourceManager.GetString("HostingUnexpectedEndOfStream", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service of type {0} cannot be created by ExtensionLoader<{1}>. - /// - public static string IncompatibleServiceForExtensionLoader { - get { - return ResourceManager.GetString("IncompatibleServiceForExtensionLoader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Multiple services found for type {0}, expected only 1. - /// - public static string MultipleServicesFound { - get { - return ResourceManager.GetString("MultipleServicesFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot register service for type {0}, one or more services already registered. - /// - public static string ServiceAlreadyRegistered { - get { - return ResourceManager.GetString("ServiceAlreadyRegistered", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service {0} was not found in the service provider. - /// - public static string ServiceNotFound { - get { - return ResourceManager.GetString("ServiceNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service of Type {0} is not compatible with registered Type {1}. - /// - public static string ServiceNotOfExpectedType { - get { - return ResourceManager.GetString("ServiceNotOfExpectedType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SetServiceProvider() was not called to establish the required service provider. - /// - public static string ServiceProviderNotSet { - get { - return ResourceManager.GetString("ServiceProviderNotSet", resourceCulture); - } - } - } -} diff --git a/src/Microsoft.SqlTools.Hosting/Properties/AssemblyInfo.cs b/src/Microsoft.SqlTools.Hosting/Properties/AssemblyInfo.cs index fe805db0..0a9499bd 100644 --- a/src/Microsoft.SqlTools.Hosting/Properties/AssemblyInfo.cs +++ b/src/Microsoft.SqlTools.Hosting/Properties/AssemblyInfo.cs @@ -44,3 +44,7 @@ using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.UnitTests")] [assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.IntegrationTests")] [assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer.Test.Common")] + +// Temporary work around for SRGen protection issues +[assembly: InternalsVisibleTo("Microsoft.SqlTools.ServiceLayer")] +[assembly: InternalsVisibleTo("Microsoft.SqlTools.Credentials")] diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.Designer.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.Designer.cs deleted file mode 100644 index 65569efd..00000000 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.Designer.cs +++ /dev/null @@ -1,962 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Microsoft.SqlTools.ServiceLayer.Localization { - using System; - using System.Reflection; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class sr { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - internal sr() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.SqlTools.ServiceLayer.Localization.sr", typeof(sr).GetTypeInfo().Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to File '{0}' recursively included.. - /// - public static string BatchParser_CircularReference { - get { - return ResourceManager.GetString("BatchParser_CircularReference", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Missing end comment mark '*/'.. - /// - public static string BatchParser_CommentNotTerminated { - get { - return ResourceManager.GetString("BatchParser_CommentNotTerminated", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect syntax was encountered while parsing '{0}'.. - /// - public static string BatchParser_IncorrectSyntax { - get { - return ResourceManager.GetString("BatchParser_IncorrectSyntax", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unclosed quotation mark after the character string.. - /// - public static string BatchParser_StringNotTerminated { - get { - return ResourceManager.GetString("BatchParser_StringNotTerminated", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Variable {0} is not defined.. - /// - public static string BatchParser_VariableNotDefined { - get { - return ResourceManager.GetString("BatchParser_VariableNotDefined", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Canceling batch parser wrapper batch execution.. - /// - public static string BatchParserWrapperExecutionEngineBatchCancelling { - get { - return ResourceManager.GetString("BatchParserWrapperExecutionEngineBatchCancelling", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Batch parser wrapper execution engine batch message received: Message: {0} Detailed message: {1}. - /// - public static string BatchParserWrapperExecutionEngineBatchMessage { - get { - return ResourceManager.GetString("BatchParserWrapperExecutionEngineBatchMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Batch parser wrapper execution engine batch ResultSet finished.. - /// - public static string BatchParserWrapperExecutionEngineBatchResultSetFinished { - get { - return ResourceManager.GetString("BatchParserWrapperExecutionEngineBatchResultSetFinished", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Batch parser wrapper execution engine batch ResultSet processing: DataReader.FieldCount: {0} DataReader.RecordsAffected: {1}. - /// - public static string BatchParserWrapperExecutionEngineBatchResultSetProcessing { - get { - return ResourceManager.GetString("BatchParserWrapperExecutionEngineBatchResultSetProcessing", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SQL Execution error: {0}. - /// - public static string BatchParserWrapperExecutionEngineError { - get { - return ResourceManager.GetString("BatchParserWrapperExecutionEngineError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Batch parser wrapper execution: {0} found... at line {1}: {2} Description: {3}. - /// - public static string BatchParserWrapperExecutionError { - get { - return ResourceManager.GetString("BatchParserWrapperExecutionError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Connection details object cannot be null. - /// - public static string ConnectionParamsValidateNullConnection { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullConnection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OwnerUri cannot be null or empty. - /// - public static string ConnectionParamsValidateNullOwnerUri { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullOwnerUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ServerName cannot be null or empty. - /// - public static string ConnectionParamsValidateNullServerName { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullServerName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} cannot be null or empty when using SqlLogin authentication. - /// - public static string ConnectionParamsValidateNullSqlAuth { - get { - return ResourceManager.GetString("ConnectionParamsValidateNullSqlAuth", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Connection parameters cannot be null. - /// - public static string ConnectionServiceConnectErrorNullParams { - get { - return ResourceManager.GetString("ConnectionServiceConnectErrorNullParams", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Connection canceled. - /// - public static string ConnectionServiceConnectionCanceled { - get { - return ResourceManager.GetString("ConnectionServiceConnectionCanceled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid value '{0}' for AuthenticationType. Valid values are 'Integrated' and 'SqlLogin'.. - /// - public static string ConnectionServiceConnStringInvalidAuthType { - get { - return ResourceManager.GetString("ConnectionServiceConnStringInvalidAuthType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid value '{0}' for ApplicationIntent. Valid values are 'ReadWrite' and 'ReadOnly'.. - /// - public static string ConnectionServiceConnStringInvalidIntent { - get { - return ResourceManager.GetString("ConnectionServiceConnStringInvalidIntent", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Specified URI '{0}' does not have a default connection. - /// - public static string ConnectionServiceDbErrorDefaultNotConnected { - get { - return ResourceManager.GetString("ConnectionServiceDbErrorDefaultNotConnected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SpecifiedUri '{0}' does not have existing connection. - /// - public static string ConnectionServiceListDbErrorNotConnected { - get { - return ResourceManager.GetString("ConnectionServiceListDbErrorNotConnected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to OwnerUri cannot be null or empty. - /// - public static string ConnectionServiceListDbErrorNullOwnerUri { - get { - return ResourceManager.GetString("ConnectionServiceListDbErrorNullOwnerUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Win32Credential object is already disposed. - /// - public static string CredentialServiceWin32CredentialDisposed { - get { - return ResourceManager.GetString("CredentialServiceWin32CredentialDisposed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid CriticalHandle!. - /// - public static string CredentialsServiceInvalidCriticalHandle { - get { - return ResourceManager.GetString("CredentialsServiceInvalidCriticalHandle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The password has exceeded 512 bytes. - /// - public static string CredentialsServicePasswordLengthExceeded { - get { - return ResourceManager.GetString("CredentialsServicePasswordLengthExceeded", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to delete a credential. - /// - public static string CredentialsServiceTargetForDelete { - get { - return ResourceManager.GetString("CredentialsServiceTargetForDelete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Target must be specified to check existance of a credential. - /// - public static string CredentialsServiceTargetForLookup { - get { - return ResourceManager.GetString("CredentialsServiceTargetForLookup", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while the batch was being processed. The error message is: {0}. - /// - public static string EE_BatchError_Exception { - get { - return ResourceManager.GetString("EE_BatchError_Exception", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while the batch was being executed.. - /// - public static string EE_BatchExecutionError_Halting { - get { - return ResourceManager.GetString("EE_BatchExecutionError_Halting", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An error occurred while the batch was being executed, but the error has been ignored.. - /// - public static string EE_BatchExecutionError_Ignoring { - get { - return ResourceManager.GetString("EE_BatchExecutionError_Ignoring", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ({0} row(s) affected). - /// - public static string EE_BatchExecutionInfo_RowsAffected { - get { - return ResourceManager.GetString("EE_BatchExecutionInfo_RowsAffected", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Msg {0}, Level {1}, State {2}. - /// - public static string EE_BatchSqlMessageNoLineInfo { - get { - return ResourceManager.GetString("EE_BatchSqlMessageNoLineInfo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Msg {0}, Level {1}, State {2}, Line {3}. - /// - public static string EE_BatchSqlMessageNoProcedureInfo { - get { - return ResourceManager.GetString("EE_BatchSqlMessageNoProcedureInfo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Msg {0}, Level {1}, State {2}, Procedure {3}, Line {4}. - /// - public static string EE_BatchSqlMessageWithProcedureInfo { - get { - return ResourceManager.GetString("EE_BatchSqlMessageWithProcedureInfo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Command {0} is not supported.. - /// - public static string EE_ExecutionError_CommandNotSupported { - get { - return ResourceManager.GetString("EE_ExecutionError_CommandNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The variable {0} could not be found.. - /// - public static string EE_ExecutionError_VariableNotFound { - get { - return ResourceManager.GetString("EE_ExecutionError_VariableNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Execution completed {0} times.... - /// - public static string EE_ExecutionInfo_FinalizingLoop { - get { - return ResourceManager.GetString("EE_ExecutionInfo_FinalizingLoop", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Starting execution loop of {0} times.... - /// - public static string EE_ExecutionInfo_InitilizingLoop { - get { - return ResourceManager.GetString("EE_ExecutionInfo_InitilizingLoop", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to You cancelled the query.. - /// - public static string EE_ExecutionInfo_QueryCancelledbyUser { - get { - return ResourceManager.GetString("EE_ExecutionInfo_QueryCancelledbyUser", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The previous execution is not yet complete.. - /// - public static string EE_ExecutionNotYetCompleteError { - get { - return ResourceManager.GetString("EE_ExecutionNotYetCompleteError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A scripting error occurred.. - /// - public static string EE_ScriptError_Error { - get { - return ResourceManager.GetString("EE_ScriptError_Error", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A fatal error occurred.. - /// - public static string EE_ScriptError_FatalError { - get { - return ResourceManager.GetString("EE_ScriptError_FatalError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Incorrect syntax was encountered while {0} was being parsed.. - /// - public static string EE_ScriptError_ParsingSyntax { - get { - return ResourceManager.GetString("EE_ScriptError_ParsingSyntax", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Scripting warning.. - /// - public static string EE_ScriptError_Warning { - get { - return ResourceManager.GetString("EE_ScriptError_Warning", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Replacement of an empty string by an empty string.. - /// - public static string ErrorEmptyStringReplacement { - get { - return ResourceManager.GetString("ErrorEmptyStringReplacement", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot convert SqlCodeObject Type {0} to Type {1}. - /// - public static string ErrorUnexpectedCodeObjectType { - get { - return ResourceManager.GetString("ErrorUnexpectedCodeObjectType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Message header must separate key and value using ':'. - /// - public static string HostingHeaderMissingColon { - get { - return ResourceManager.GetString("HostingHeaderMissingColon", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fatal error: Content-Length header must be provided. - /// - public static string HostingHeaderMissingContentLengthHeader { - get { - return ResourceManager.GetString("HostingHeaderMissingContentLengthHeader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Fatal error: Content-Length value is not an integer. - /// - public static string HostingHeaderMissingContentLengthValue { - get { - return ResourceManager.GetString("HostingHeaderMissingContentLengthValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to MessageReader's input stream ended unexpectedly, terminating. - /// - public static string HostingUnexpectedEndOfStream { - get { - return ResourceManager.GetString("HostingUnexpectedEndOfStream", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service of type {0} cannot be created by ExtensionLoader<{1}>. - /// - public static string IncompatibleServiceForExtensionLoader { - get { - return ResourceManager.GetString("IncompatibleServiceForExtensionLoader", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Multiple services found for type {0}, expected only 1. - /// - public static string MultipleServicesFound { - get { - return ResourceManager.GetString("MultipleServicesFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This feature is currently not supported on Azure SQL DB and Data Warehouse: {0}. - /// - public static string PeekDefinitionAzureError { - get { - return ResourceManager.GetString("PeekDefinitionAzureError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No database object was retrieved.. - /// - public static string PeekDefinitionDatabaseError { - get { - return ResourceManager.GetString("PeekDefinitionDatabaseError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An unexpected error occurred during Peek Definition execution: {0}. - /// - public static string PeekDefinitionError { - get { - return ResourceManager.GetString("PeekDefinitionError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to No results were found.. - /// - public static string PeekDefinitionNoResultsError { - get { - return ResourceManager.GetString("PeekDefinitionNoResultsError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Please connect to a server.. - /// - public static string PeekDefinitionNotConnectedError { - get { - return ResourceManager.GetString("PeekDefinitionNotConnectedError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Operation timed out.. - /// - public static string PeekDefinitionTimedoutError { - get { - return ResourceManager.GetString("PeekDefinitionTimedoutError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This object type is currently not supported by this feature.. - /// - public static string PeekDefinitionTypeNotSupportedError { - get { - return ResourceManager.GetString("PeekDefinitionTypeNotSupportedError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (1 row affected). - /// - public static string QueryServiceAffectedOneRow { - get { - return ResourceManager.GetString("QueryServiceAffectedOneRow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to ({0} rows affected). - /// - public static string QueryServiceAffectedRows { - get { - return ResourceManager.GetString("QueryServiceAffectedRows", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The query has already completed, it cannot be cancelled. - /// - public static string QueryServiceCancelAlreadyCompleted { - get { - return ResourceManager.GetString("QueryServiceCancelAlreadyCompleted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Query successfully cancelled, failed to dispose query. Owner URI not found.. - /// - public static string QueryServiceCancelDisposeFailed { - get { - return ResourceManager.GetString("QueryServiceCancelDisposeFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to (No column name). - /// - public static string QueryServiceColumnNull { - get { - return ResourceManager.GetString("QueryServiceColumnNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Commands completed successfully.. - /// - public static string QueryServiceCompletedSuccessfully { - get { - return ResourceManager.GetString("QueryServiceCompletedSuccessfully", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Maximum number of bytes to return must be greater than zero. - /// - public static string QueryServiceDataReaderByteCountInvalid { - get { - return ResourceManager.GetString("QueryServiceDataReaderByteCountInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Maximum number of chars to return must be greater than zero. - /// - public static string QueryServiceDataReaderCharCountInvalid { - get { - return ResourceManager.GetString("QueryServiceDataReaderCharCountInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Maximum number of XML bytes to return must be greater than zero. - /// - public static string QueryServiceDataReaderXmlCountInvalid { - get { - return ResourceManager.GetString("QueryServiceDataReaderXmlCountInvalid", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Msg {0}, Level {1}, State {2}, Line {3}{4}{5}. - /// - public static string QueryServiceErrorFormat { - get { - return ResourceManager.GetString("QueryServiceErrorFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not retrieve an execution plan from the result set . - /// - public static string QueryServiceExecutionPlanNotFound { - get { - return ResourceManager.GetString("QueryServiceExecutionPlanNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FileStreamWrapper must be initialized before performing operations. - /// - public static string QueryServiceFileWrapperNotInitialized { - get { - return ResourceManager.GetString("QueryServiceFileWrapperNotInitialized", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This FileStreamWrapper cannot be used for writing. - /// - public static string QueryServiceFileWrapperReadOnly { - get { - return ResourceManager.GetString("QueryServiceFileWrapperReadOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Access method cannot be write-only. - /// - public static string QueryServiceFileWrapperWriteOnly { - get { - return ResourceManager.GetString("QueryServiceFileWrapperWriteOnly", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Sender for OnInfoMessage event must be a SqlConnection. - /// - public static string QueryServiceMessageSenderNotSql { - get { - return ResourceManager.GetString("QueryServiceMessageSenderNotSql", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Query was canceled by user. - /// - public static string QueryServiceQueryCancelled { - get { - return ResourceManager.GetString("QueryServiceQueryCancelled", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Query failed: {0}. - /// - public static string QueryServiceQueryFailed { - get { - return ResourceManager.GetString("QueryServiceQueryFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A query is already in progress for this editor session. Please cancel this query or wait for its completion.. - /// - public static string QueryServiceQueryInProgress { - get { - return ResourceManager.GetString("QueryServiceQueryInProgress", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to This editor is not connected to a database. - /// - public static string QueryServiceQueryInvalidOwnerUri { - get { - return ResourceManager.GetString("QueryServiceQueryInvalidOwnerUri", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The requested query does not exist. - /// - public static string QueryServiceRequestsNoQuery { - get { - return ResourceManager.GetString("QueryServiceRequestsNoQuery", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not retrieve column schema for result set. - /// - public static string QueryServiceResultSetNoColumnSchema { - get { - return ResourceManager.GetString("QueryServiceResultSetNoColumnSchema", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot read subset unless the results have been read from the server. - /// - public static string QueryServiceResultSetNotRead { - get { - return ResourceManager.GetString("QueryServiceResultSetNotRead", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Reader cannot be null. - /// - public static string QueryServiceResultSetReaderNull { - get { - return ResourceManager.GetString("QueryServiceResultSetReaderNull", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Row count must be a positive integer. - /// - public static string QueryServiceResultSetRowCountOutOfRange { - get { - return ResourceManager.GetString("QueryServiceResultSetRowCountOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Start row cannot be less than 0 or greater than the number of rows in the result set. - /// - public static string QueryServiceResultSetStartRowOutOfRange { - get { - return ResourceManager.GetString("QueryServiceResultSetStartRowOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to save {0}: {1}. - /// - public static string QueryServiceSaveAsFail { - get { - return ResourceManager.GetString("QueryServiceSaveAsFail", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A save request to the same path is in progress. - /// - public static string QueryServiceSaveAsInProgress { - get { - return ResourceManager.GetString("QueryServiceSaveAsInProgress", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Internal error occurred while starting save task. - /// - public static string QueryServiceSaveAsMiscStartingError { - get { - return ResourceManager.GetString("QueryServiceSaveAsMiscStartingError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Result cannot be saved until query execution has completed. - /// - public static string QueryServiceSaveAsResultSetNotComplete { - get { - return ResourceManager.GetString("QueryServiceSaveAsResultSetNotComplete", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The batch has not completed, yet. - /// - public static string QueryServiceSubsetBatchNotCompleted { - get { - return ResourceManager.GetString("QueryServiceSubsetBatchNotCompleted", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Batch index cannot be less than 0 or greater than the number of batches. - /// - public static string QueryServiceSubsetBatchOutOfRange { - get { - return ResourceManager.GetString("QueryServiceSubsetBatchOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Result set index cannot be less than 0 or greater than the number of result sets. - /// - public static string QueryServiceSubsetResultSetOutOfRange { - get { - return ResourceManager.GetString("QueryServiceSubsetResultSetOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot register service for type {0}, one or more services already registered. - /// - public static string ServiceAlreadyRegistered { - get { - return ResourceManager.GetString("ServiceAlreadyRegistered", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service {0} was not found in the service provider. - /// - public static string ServiceNotFound { - get { - return ResourceManager.GetString("ServiceNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Service of Type {0} is not compatible with registered Type {1}. - /// - public static string ServiceNotOfExpectedType { - get { - return ResourceManager.GetString("ServiceNotOfExpectedType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SetServiceProvider() was not called to establish the required service provider. - /// - public static string ServiceProviderNotSet { - get { - return ResourceManager.GetString("ServiceProviderNotSet", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to EN_LOCALIZATION. - /// - public static string TestLocalizationConstant { - get { - return ResourceManager.GetString("TestLocalizationConstant", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to For more information about this error, see the troubleshooting topics in the product documentation.. - /// - public static string TroubleshootingAssistanceMessage { - get { - return ResourceManager.GetString("TroubleshootingAssistanceMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Start position ({0}, {1}) must come before or be equal to the end position ({2}, {3}). - /// - public static string WorkspaceServiceBufferPositionOutOfOrder { - get { - return ResourceManager.GetString("WorkspaceServiceBufferPositionOutOfOrder", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Position is outside of column range for line {0}. - /// - public static string WorkspaceServicePositionColumnOutOfRange { - get { - return ResourceManager.GetString("WorkspaceServicePositionColumnOutOfRange", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Position is outside of file line range. - /// - public static string WorkspaceServicePositionLineOutOfRange { - get { - return ResourceManager.GetString("WorkspaceServicePositionLineOutOfRange", resourceCulture); - } - } - } -} diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNode.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNode.cs index 85078a27..4c2b2c9a 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNode.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNode.cs @@ -7,12 +7,12 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; -using System.Globalization; -using Microsoft.SqlTools.ServiceLayer.Metadata.Contracts; +using System.Globalization; +using Microsoft.SqlTools.ServiceLayer.Metadata.Contracts; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel; -using Microsoft.SqlTools.Utility; - +using Microsoft.SqlTools.Utility; + namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes { /// @@ -25,7 +25,6 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes private TreeNode parent; private string nodePath; private string label; - private ObjectExplorerService objectExplorerService; public const char PathPartSeperator = '/'; /// @@ -53,8 +52,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes public string NodeValue { get; set; } - /// - /// Object metadata for smo objects + /// + /// Object metadata for smo objects /// public ObjectMetadata ObjectMetadata { get; set; } @@ -151,17 +150,17 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes nodePath = path; } - public TreeNode FindNodeByPath(string path) - { - TreeNode nodeForPath = ObjectExplorerUtils.FindNode(this, node => - { - return node.GetNodePath() == path; - }, nodeToFilter => - { - return path.StartsWith(nodeToFilter.GetNodePath()); - }); - - return nodeForPath; + public TreeNode FindNodeByPath(string path) + { + TreeNode nodeForPath = ObjectExplorerUtils.FindNode(this, node => + { + return node.GetNodePath() == path; + }, nodeToFilter => + { + return path.StartsWith(nodeToFilter.GetNodePath()); + }); + + return nodeForPath; } /// diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ObjectExplorerService.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ObjectExplorerService.cs index 9917d9b9..66b97e34 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ObjectExplorerService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ObjectExplorerService.cs @@ -5,20 +5,20 @@ using System; using System.Collections.Generic; -using System.Composition; +using System.Composition; using System.Globalization; -using System.Linq; +using System.Linq; using System.Threading.Tasks; -using Microsoft.SqlTools.Extensibility; -using Microsoft.SqlTools.Hosting; -using Microsoft.SqlTools.Hosting.Protocol; +using Microsoft.SqlTools.Extensibility; +using Microsoft.SqlTools.Hosting; +using Microsoft.SqlTools.Hosting.Protocol; using Microsoft.SqlTools.ServiceLayer.Connection; using Microsoft.SqlTools.ServiceLayer.Connection.Contracts; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel; -using Microsoft.SqlTools.Utility; - +using Microsoft.SqlTools.Utility; + namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer { /// @@ -61,8 +61,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer { return applicableNodeChildFactories.Value; } - } - + } + /// /// As an , this will be set whenever the service is initialized /// via an @@ -126,18 +126,18 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer await HandleRequestAsync(doCreateSession, context, "HandleCreateSessionRequest"); } - internal async Task ExpandNode(ObjectExplorerSession session, string nodePath) - { - return await Task.Factory.StartNew(() => - { - NodeInfo[] nodes = null; - TreeNode node = session.Root.FindNodeByPath(nodePath); - if(node != null) - { - nodes = node.Expand().Select(x => x.ToNodeInfo()).ToArray(); - } - return nodes; - }); + internal async Task ExpandNode(ObjectExplorerSession session, string nodePath) + { + return await Task.Factory.StartNew(() => + { + NodeInfo[] nodes = null; + TreeNode node = session.Root.FindNodeByPath(nodePath); + if(node != null) + { + nodes = node.Expand().Select(x => x.ToNodeInfo()).ToArray(); + } + return nodes; + }); } /// @@ -168,14 +168,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer { // open connection based on request details ConnectionCompleteParams result = await connectionService.Connect(connectParams); - if(result != null && !string.IsNullOrEmpty(result.ConnectionId)) - { - return result; + if(result != null && !string.IsNullOrEmpty(result.ConnectionId)) + { + return result; } - else - { - await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result); - return null; + else + { + await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result); + return null; } } @@ -202,13 +202,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer string uri = expandParams.SessionId; ObjectExplorerSession session = null; NodeInfo[] nodes = null; - if (sessionMap.ContainsKey(uri)) - { - session = sessionMap[uri]; + if (sessionMap.ContainsKey(uri)) + { + session = sessionMap[uri]; } - else - { - //TODO: error + else + { + //TODO: error } @@ -303,11 +303,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer { if (serviceProvider == null) { - throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet); + throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet); } if (connectionService == null) { - throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet); + throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet); } } @@ -320,7 +320,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer childFactories[parent] = applicableFactories; } applicableFactories.Add(factory); - } + } internal class ObjectExplorerSession { diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryContext.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryContext.cs index d933c5f9..73758a3c 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryContext.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryContext.cs @@ -8,7 +8,7 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; using Microsoft.SqlServer.Management.Smo; -using Microsoft.SqlTools.Extensibility; +using Microsoft.SqlTools.Extensibility; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel @@ -73,13 +73,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { if (ServiceProvider == null) { - throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet); + throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet); } ObjectExplorerService service = ServiceProvider.GetService(); if (service == null) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - SqlTools.Hosting.Localization.sr.ServiceNotFound, nameof(ObjectExplorerService))); + SqlTools.Hosting.SR.ServiceNotFound, nameof(ObjectExplorerService))); } return service; diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs index 1df00d1d..f2407b6b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs @@ -1,16 +1,16 @@ -// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file -// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool", -// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen". - -using System; -using System.Collections.Generic; -using System.Composition; -using System.Linq; -using Microsoft.SqlServer.Management.Smo; -using Microsoft.SqlServer.Management.Smo.Broker; - -namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel -{ +// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file +// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool", +// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen". + +using System; +using System.Collections.Generic; +using System.Composition; +using System.Linq; +using Microsoft.SqlServer.Management.Smo; +using Microsoft.SqlServer.Management.Smo.Broker; + +namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel +{ [Export(typeof(SmoQuerier))] internal partial class SqlDatabaseQuerier: SmoQuerier @@ -1569,5 +1569,5 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel return Enumerable.Empty(); } } -} - +} + diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs index 8e4aff28..96c51c23 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Composition; -using Microsoft.SqlTools.ServiceLayer; -using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; - -namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel -{ - +using System; +using System.Collections.Generic; +using System.Composition; +using Microsoft.SqlTools.ServiceLayer; +using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; + +namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel +{ + internal sealed partial class DatabaseInstanceTreeNode : SmoTreeNode { public DatabaseInstanceTreeNode() : base() @@ -3452,5 +3452,5 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel } } -} - +} + diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs index a629c750..996aae99 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs @@ -6,9 +6,7 @@ using System.Globalization; using Xunit; -using ServiceLayerSr = Microsoft.SqlTools.ServiceLayer.Localization.sr; -using HostingSr = Microsoft.SqlTools.Hosting.Localization.sr; -using CredentialSr = Microsoft.SqlTools.Credentials.Localization.sr; +using ServiceLayerSr = Microsoft.SqlTools.ServiceLayer.SR; namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility { @@ -20,13 +18,13 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility [Fact] public void SrPropertiesTest() { - Assert.NotNull(SR.QueryServiceSubsetBatchNotCompleted); - Assert.NotNull(SR.QueryServiceFileWrapperWriteOnly); - Assert.NotNull(SR.QueryServiceFileWrapperNotInitialized); - Assert.NotNull(SR.QueryServiceColumnNull); - - Assert.NotNull(ServiceLayerSr.ResourceManager); ServiceLayerSr.Culture = CultureInfo.CurrentCulture; + + // Assert all needed constants exist + Assert.NotNull(ServiceLayerSr.QueryServiceSubsetBatchNotCompleted); + Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperWriteOnly); + Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperNotInitialized); + Assert.NotNull(ServiceLayerSr.QueryServiceColumnNull); Assert.NotNull(ServiceLayerSr.Culture); Assert.NotNull(ServiceLayerSr.BatchParser_CircularReference); Assert.NotNull(ServiceLayerSr.BatchParser_CommentNotTerminated); @@ -42,19 +40,14 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullConnection); Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullOwnerUri); Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullServerName); - Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullSqlAuth); + Assert.NotNull(ServiceLayerSr.ConnectionParamsValidateNullSqlAuth("")); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnectErrorNullParams); Assert.NotNull(ServiceLayerSr.ConnectionServiceConnectionCanceled); - Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidAuthType); - Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidIntent); - Assert.NotNull(ServiceLayerSr.ConnectionServiceDbErrorDefaultNotConnected); - Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNotConnected); + Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidAuthType("")); + Assert.NotNull(ServiceLayerSr.ConnectionServiceConnStringInvalidIntent("")); + Assert.NotNull(ServiceLayerSr.ConnectionServiceDbErrorDefaultNotConnected("")); + Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNotConnected("")); Assert.NotNull(ServiceLayerSr.ConnectionServiceListDbErrorNullOwnerUri); - Assert.Null(ServiceLayerSr.CredentialServiceWin32CredentialDisposed); - Assert.Null(ServiceLayerSr.CredentialsServiceInvalidCriticalHandle); - Assert.Null(ServiceLayerSr.CredentialsServicePasswordLengthExceeded); - Assert.Null(ServiceLayerSr.CredentialsServiceTargetForDelete); - Assert.Null(ServiceLayerSr.CredentialsServiceTargetForLookup); Assert.NotNull(ServiceLayerSr.EE_BatchError_Exception); Assert.NotNull(ServiceLayerSr.EE_BatchExecutionError_Halting); Assert.NotNull(ServiceLayerSr.EE_BatchExecutionError_Ignoring); @@ -73,20 +66,14 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility Assert.NotNull(ServiceLayerSr.EE_ScriptError_ParsingSyntax); Assert.NotNull(ServiceLayerSr.EE_ScriptError_Warning); Assert.NotNull(ServiceLayerSr.ErrorEmptyStringReplacement); - Assert.Null(ServiceLayerSr.HostingHeaderMissingColon); - Assert.Null(ServiceLayerSr.HostingHeaderMissingContentLengthHeader); - Assert.Null(ServiceLayerSr.HostingHeaderMissingContentLengthValue); - Assert.Null(ServiceLayerSr.HostingUnexpectedEndOfStream); - Assert.Null(ServiceLayerSr.IncompatibleServiceForExtensionLoader); - Assert.Null(ServiceLayerSr.MultipleServicesFound); - Assert.NotNull(ServiceLayerSr.PeekDefinitionAzureError); + Assert.NotNull(ServiceLayerSr.PeekDefinitionAzureError("")); Assert.NotNull(ServiceLayerSr.PeekDefinitionDatabaseError); - Assert.NotNull(ServiceLayerSr.PeekDefinitionError); + Assert.NotNull(ServiceLayerSr.PeekDefinitionError("")); Assert.NotNull(ServiceLayerSr.PeekDefinitionNoResultsError); Assert.NotNull(ServiceLayerSr.PeekDefinitionNotConnectedError); Assert.NotNull(ServiceLayerSr.PeekDefinitionTimedoutError); Assert.NotNull(ServiceLayerSr.QueryServiceAffectedOneRow); - Assert.NotNull(ServiceLayerSr.QueryServiceAffectedRows); + Assert.NotNull(ServiceLayerSr.QueryServiceAffectedRows(0)); Assert.NotNull(ServiceLayerSr.QueryServiceCancelAlreadyCompleted); Assert.NotNull(ServiceLayerSr.QueryServiceCancelDisposeFailed); Assert.NotNull(ServiceLayerSr.QueryServiceColumnNull); @@ -94,37 +81,32 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility Assert.NotNull(ServiceLayerSr.QueryServiceDataReaderByteCountInvalid); Assert.NotNull(ServiceLayerSr.QueryServiceDataReaderCharCountInvalid); Assert.NotNull(ServiceLayerSr.QueryServiceDataReaderXmlCountInvalid); - Assert.NotNull(ServiceLayerSr.QueryServiceErrorFormat); + Assert.NotNull(ServiceLayerSr.QueryServiceErrorFormat(0,0,0,0,"","")); Assert.NotNull(ServiceLayerSr.QueryServiceExecutionPlanNotFound); Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperNotInitialized); Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperReadOnly); Assert.NotNull(ServiceLayerSr.QueryServiceFileWrapperWriteOnly); Assert.NotNull(ServiceLayerSr.QueryServiceMessageSenderNotSql); Assert.NotNull(ServiceLayerSr.QueryServiceQueryCancelled); - Assert.NotNull(ServiceLayerSr.QueryServiceQueryFailed); + Assert.NotNull(ServiceLayerSr.QueryServiceQueryFailed("")); Assert.NotNull(ServiceLayerSr.QueryServiceQueryInProgress); Assert.NotNull(ServiceLayerSr.QueryServiceQueryInvalidOwnerUri); Assert.NotNull(ServiceLayerSr.QueryServiceRequestsNoQuery); Assert.NotNull(ServiceLayerSr.QueryServiceResultSetNoColumnSchema); Assert.NotNull(ServiceLayerSr.QueryServiceResultSetNotRead); - Assert.Null(ServiceLayerSr.QueryServiceResultSetReaderNull); Assert.NotNull(ServiceLayerSr.QueryServiceResultSetRowCountOutOfRange); Assert.NotNull(ServiceLayerSr.QueryServiceResultSetStartRowOutOfRange); - Assert.NotNull(ServiceLayerSr.QueryServiceSaveAsFail); + Assert.NotNull(ServiceLayerSr.QueryServiceSaveAsFail("","")); Assert.NotNull(ServiceLayerSr.QueryServiceSaveAsInProgress); Assert.NotNull(ServiceLayerSr.QueryServiceSaveAsMiscStartingError); Assert.NotNull(ServiceLayerSr.QueryServiceSaveAsResultSetNotComplete); Assert.NotNull(ServiceLayerSr.QueryServiceSubsetBatchNotCompleted); Assert.NotNull(ServiceLayerSr.QueryServiceSubsetBatchOutOfRange); Assert.NotNull(ServiceLayerSr.QueryServiceSubsetResultSetOutOfRange); - Assert.Null(ServiceLayerSr.ServiceAlreadyRegistered); - Assert.Null(ServiceLayerSr.ServiceNotFound); - Assert.Null(ServiceLayerSr.ServiceNotOfExpectedType); - Assert.Null(ServiceLayerSr.ServiceProviderNotSet); Assert.NotNull(ServiceLayerSr.TestLocalizationConstant); Assert.NotNull(ServiceLayerSr.TroubleshootingAssistanceMessage); - Assert.NotNull(ServiceLayerSr.WorkspaceServiceBufferPositionOutOfOrder); - Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionColumnOutOfRange); + Assert.NotNull(ServiceLayerSr.WorkspaceServiceBufferPositionOutOfOrder(0,0,0,0)); + Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionColumnOutOfRange(0)); Assert.NotNull(ServiceLayerSr.WorkspaceServicePositionLineOutOfRange); } }