From c248400a6cb0fb81ad812a954048cbadec36ffa3 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Fri, 4 Mar 2022 15:17:29 -0800 Subject: [PATCH] Add linting for copyright and unused usings (#1416) * Add linting for copyright and unused usings * Add one more + comment * Enforce in build and fix errors * Fix build --- .editorconfig | 345 ++++++++++++++++++ Directory.Build.props | 1 + build.cake | 2 +- src/Microsoft.InsightsGenerator/SigGen.cs | 8 +- .../Connection/CancelTokenKey.cs | 7 +- .../Connection/ConnectionManager.cs | 5 + .../Contracts/RequestSecurityTokenParams.cs | 5 + .../Contracts/RequestSecurityTokenResponse.cs | 5 + .../Contracts/SecurityTokenRequest.cs | 5 + .../Connection/IConnectionManager.cs | 5 + .../Connection/IConnectionService.cs | 5 + .../Contracts/DataSourceConnectionDetails.cs | 5 + .../DataSource/DataReaderWrapper.cs | 8 +- .../DataSource/DataSourceBase.cs | 7 +- .../DataSource/DataSourceFactory.cs | 7 +- .../DataSource/DataSourceType.cs | 7 +- .../DataSource/DiagnosticsInfo.cs | 7 +- .../DataSource/IDataSource.cs | 7 +- .../DataSource/IDataSourceFactory.cs | 5 + .../Intellisense/IntellisenseClientBase.cs | 5 + .../Intellisense/ShowDatabaseSchemaResult.cs | 5 + .../Intellisense/ShowDatabasesResult.cs | 5 + .../Intellisense/ShowFunctionsResult.cs | 5 + .../DataSource/Kusto/IKustoClient.cs | 5 + .../DataSource/Kusto/KustoClient.cs | 5 + .../DataSource/Kusto/KustoDataSource.cs | 7 +- .../Kusto/KustoIntellisenseClient.cs | 5 + .../DataSource/Kusto/KustoResultsReader.cs | 7 +- .../DataSource/KustoQueryUtils.cs | 8 +- .../DataSource/Metadata/ColumnMetadata.cs | 7 +- .../Metadata/DataSourceMetadataType.cs | 7 +- .../Metadata/DataSourceObjectMetadata.cs | 7 +- .../DataSource/Metadata/DatabaseMetadata.cs | 7 +- .../DataSource/Metadata/FolderMetadata.cs | 7 +- .../DataSource/Metadata/FunctionMetadata.cs | 7 +- .../DataSource/Metadata/MetadataFactory.cs | 7 +- .../DataSource/Metadata/TableMetadata.cs | 7 +- .../DataSource/Models/ColumnInfo.cs | 7 +- .../DataSource/Models/FunctionInfo.cs | 7 +- .../DataSource/Models/TableInfo.cs | 7 +- .../DataSource/Monitor/MonitorClient.cs | 5 + .../DataSource/Monitor/MonitorDataSource.cs | 5 + .../DataSource/Monitor/MonitorExtensions.cs | 5 + .../Monitor/MonitorIntellisenseClient.cs | 5 + .../Monitor/Responses/Models/ColumnsModel.cs | 5 + .../Responses/Models/TableGroupsModel.cs | 5 + .../Monitor/Responses/Models/TablesModel.cs | 5 + .../Responses/Models/WorkspacesModel.cs | 5 + .../Monitor/Responses/WorkspaceResponse.cs | 5 + .../HostLoader.cs | 1 + .../IConnectedBindingQueue.cs | 7 +- .../ObjectExplorer/ObjectExplorerSession.cs | 5 + .../ObjectExplorer/ValidForFlag.cs | 7 +- src/Microsoft.Kusto.ServiceLayer/Program.cs | 2 + .../QueryExecution/Batch.cs | 3 +- .../Contracts/DbColumnWrapper.cs | 3 +- .../Contracts/ExecuteRequests/BatchEvents.cs | 3 +- .../ExecuteRequests/ExecuteRequestResult.cs | 3 +- .../ExecuteRequests/ResultSetEvents.cs | 3 +- .../Contracts/ExecutionPlanOptions.cs | 3 +- .../QueryExecution/Contracts/SelectionData.cs | 3 +- .../QueryExecution/ResultOnlyContext.cs | 3 +- .../QueryExecution/ResultSet.cs | 3 +- .../QueryExecution/SpecialAction.cs | 4 +- .../Scripting/IScripter.cs | 7 +- .../Utility/AccessTokenProvider.cs | 7 +- .../Utility/ServiceLayerCommandOptions.cs | 1 + .../Utility/SystemExtensions.cs | 7 +- .../Utility/ValidationUtils.cs | 7 +- .../.editorconfig | 15 + .../Utility/AutoLock.cs | 1 + .../Utility/ConcurrentCache.cs | 1 + .../ExecutionEngineCode/BatchDefinition.cs | 3 +- .../Authentication/IAccountManager.cs | 7 +- .../IAzureAuthenticationManager.cs | 5 +- .../IAzureSubscriptionContext.cs | 1 + .../IAzureSubscriptionIdentifier.cs | 3 +- .../Authentication/IAzureTenant.cs | 5 +- .../Authentication/IAzureUserAccount.cs | 1 + .../IAzureUserAccountDisplayInfo.cs | 1 + .../IAzureUserAccountSubscriptionContext.cs | 3 +- .../Authentication/IUserAccount.cs | 5 +- .../AuthenticationService.cs | 4 +- .../Common/CommonUtil.cs | 7 +- .../Common/ConnectionConstants.cs | 1 + .../Common/ExceptionUtil.cs | 3 +- .../Common/ExpiredTokenException.cs | 7 +- .../Common/ServiceExceptionBase.cs | 10 +- .../Common/ServiceFailedException.cs | 10 +- .../UserNeedsAuthenticationException.cs | 7 +- .../Contracts/Account.cs | 4 +- .../Contracts/FirewallRule.cs | 6 +- .../AzureDatabaseDiscoveryProvider.cs | 29 +- .../AzureServerDatabaseDiscoveryProvider.cs | 5 +- .../AzureSqlServerDiscoveryProvider.cs | 11 +- .../Discovery/AzureUtil.cs | 1 + .../Discovery/DatabaseInfoEventArgs.cs | 1 + .../Discovery/DatabaseInstanceInfo.cs | 5 +- .../Discovery/IAzureResource.cs | 1 + .../IAzureResourceManagementSession.cs | 3 +- .../Discovery/IAzureResourceManager.cs | 9 +- .../Discovery/IAzureSqlServerResource.cs | 3 +- .../Discovery/ICacheable.cs | 7 +- .../Discovery/IDatabaseDiscoveryProvider.cs | 17 +- .../Discovery/ISecureService.cs | 5 +- .../Discovery/IServerDiscoveryProvider.cs | 7 +- .../Discovery/ServerDefinition.cs | 11 +- .../Discovery/ServerInstanceInfo.cs | 5 +- .../Discovery/ServerTypes.cs | 7 +- .../Discovery/ServiceResponse.cs | 7 +- .../Extensibility/ExportableAttribute.cs | 26 +- .../Extensibility/ExportableBase.cs | 8 +- .../Extensibility/ExportableStatus.cs | 2 +- .../Extensibility/ExtensionUtils.cs | 18 +- .../Extensibility/IExportable.cs | 2 +- .../Extensibility/ITrace.cs | 4 +- .../Extensibility/TraceId.cs | 2 +- .../Extensibility/TraceableBase.cs | 18 +- .../Firewall/FirewallErrorParser.cs | 19 +- .../Firewall/FirewallParserResponse.cs | 1 + .../Firewall/FirewallRuleException.cs | 9 +- .../Firewall/FirewallRuleRequest.cs | 5 +- .../Firewall/FirewallRuleResource.cs | 3 +- .../Firewall/FirewallRuleResponse.cs | 1 + .../Firewall/FirewallRuleService.cs | 31 +- .../ResourceProviderService.cs | 10 +- .../AzureAuthenticationManager.cs | 11 +- .../AzureResourceFailedException.cs | 11 +- .../AzureResourceManagementSession.cs | 7 +- .../AzureResourceManager.cs | 5 +- .../AzureResourceWrapper.cs | 9 +- .../AzureSubscriptionContext.cs | 3 +- .../AzureSubscriptionIdentifier.cs | 5 +- .../AzureTenant.cs | 7 +- .../AzureUserAccount.cs | 7 +- .../AzureUserAccountDisplayInfo.cs | 5 +- .../AzureUserAccountSubscriptionContext.cs | 5 +- .../SqlAzureResource.cs | 3 +- .../Program.cs | 1 + .../ResourceProviderHostLoader.cs | 1 + .../AzureFunctions/AzureFunctionsUtils.cs | 7 +- .../Connection/CancelTokenKey.cs | 7 +- .../Connection/ConnectionService.cs | 1 - .../Contracts/SecurityTokenRequest.cs | 7 +- .../DisasterRecovery/CommonUtilities.cs | 7 +- .../DisasterRecoveryConstants.cs | 7 +- .../EditData/Contracts/EditCellResult.cs | 7 +- .../HostLoader.cs | 1 + .../Management/Common/ExecutionHandler.cs | 5 + .../NotebookConvert/Notebook.cs | 7 +- .../Nodes/TreeNodeWithContext.cs | 7 +- .../ObjectExplorer/SmoModel/SmoQueryModel.cs | 7 +- .../ObjectExplorer/SmoModel/SmoQueryModel.tt | 31 +- .../SmoModel/TreeNodeGenerator.cs | 10 +- .../SmoModel/TreeNodeGenerator.tt | 84 +++-- .../ObjectExplorer/ValidForFlag.cs | 7 +- .../Program.cs | 2 + .../QueryExecution/Batch.cs | 3 +- .../Contracts/DbColumnWrapper.cs | 3 +- .../Contracts/ExecuteRequests/BatchEvents.cs | 3 +- .../ExecuteRequests/ExecuteRequestResult.cs | 3 +- .../ExecuteRequests/ResultSetEvents.cs | 3 +- .../Contracts/ExecutionPlanOptions.cs | 3 +- .../QueryExecution/Contracts/SelectionData.cs | 3 +- .../QueryExecution/ResultOnlyContext.cs | 3 +- .../QueryExecution/ResultSet.cs | 3 +- .../QueryExecution/SpecialAction.cs | 4 +- .../Utility/AccessTokenProvider.cs | 7 +- .../Utility/ServiceLayerCommandOptions.cs | 1 + .../SignatureGeneratorTests.cs | 6 +- .../WorkflowTests.cs | 5 + .../Admin/AdminServiceTests.cs | 5 + .../Connection/ConnectionInfoTests.cs | 5 + .../ConnectionProviderOptionsHelperTests.cs | 5 + .../DataSourceConnectionFactoryTests.cs | 5 + .../DataSource/DataSourceFactoryTests.cs | 5 + .../KustoIntellisenseClientTests.cs | 5 + .../KustoIntellisenseHelperTests.cs | 5 + .../DataSource/KustoClientTests.cs | 5 + .../DataSource/KustoQueryUtilsTests.cs | 5 + .../Metadata/MetadataFactoryTests.cs | 5 + .../AutoCompleteHelperTests.cs | 5 + .../LanguageServices/BindingQueueTests.cs | 5 + .../ConnectedBindingQueueTests.cs | 5 + .../DiagnosticsHelperTests.cs | 5 + .../Metadata/MetadataServiceTests.cs | 5 + .../DataSourceModel/ServerNodeTests.cs | 5 + .../Scripting/ScripterTests.cs | 5 + .../ServiceHost/SrTests.cs | 1 + .../Utility/FileUtilities.cs | 7 +- .../Utility/LiveConnectionHelper.cs | 7 +- .../Agent/AgentNotebookTests.cs | 5 + .../AzureFunctionsServiceTests.cs | 7 +- .../TaskServices/RequstParamStub.cs | 7 +- .../Utility/LiveConnectionHelper.cs | 7 +- .../Properties/AssemblyInfo.cs | 7 +- .../Extensions/ExceptionExtensions.cs | 7 +- .../MemoryFileSystem.cs | 7 +- .../TestEventContext.cs | 7 +- .../Properties/AssemblyInfo.cs | 7 +- .../Properties/AssemblyInfo.cs | 7 +- .../Credentials/SrTests.cs | 1 + .../Credentials/Win32/CredentialSetTests.cs | 4 +- .../Credentials/Win32/Win32CredentialTests.cs | 4 +- .../ExternalLanguageOperationTests.cs | 7 +- .../AzureDatabaseDiscoveryProviderTest.cs | 1 + .../AzureSqlServerDiscoveryProviderTest.cs | 1 + .../Azure/AzureSubscriptionContextTest.cs | 1 + .../Azure/AzureTestContext.cs | 1 + .../Azure/FakeAzureServerDiscoveryProvider.cs | 1 + .../ResourceProvider/DependencyManagerTest.cs | 1 + .../ResourceProvider/ExceptionUtilTest.cs | 1 + .../Fakes/FakeAccountManager.cs | 1 + .../Fakes/FakeAccountManager2.cs | 1 + .../ResourceProvider/Fakes/FakeDataFactory.cs | 1 + .../Fakes/FakeDatabaseDiscoveryProvider.cs | 1 + .../Fakes/FakeDatabaseResourceManager.cs | 1 + .../FakeSecureServerDiscoveryProvider.cs | 1 + .../Fakes/FakeServerDiscoveryProvider.cs | 1 + .../Fakes/FakeServerDiscoveryProvider2.cs | 1 + .../ResourceProvider/Fakes/FakeTrace.cs | 1 + .../FirewallErrorParserTest.cs | 1 + .../FirewallRuleServiceTest.cs | 1 + .../ResourceProvider/ServiceManagerTest.cs | 1 + .../ScriptingExtensionMethodsTests.cs | 7 +- .../ServiceHost/LoggerTests.cs | 1 + .../ServiceHost/ScriptFileTests.cs | 1 + .../ServiceHost/SrTests.cs | 1 + .../ShowPlan/ShowPlanTests.cs | 5 + .../Utility/TestDbColumn.cs | 3 +- .../Utility/TestUtils.cs | 7 +- .../UtilityTests/ToSqlScriptTests.cs | 7 +- test/ScriptGenerator/Program.cs | 8 +- 233 files changed, 1323 insertions(+), 364 deletions(-) create mode 100644 .editorconfig create mode 100644 src/Microsoft.SqlTools.Credentials/.editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..0f0b6b33 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,345 @@ +# See https://github.com/dotnet/roslyn-analyzers/blob/main/.editorconfig for an example on different settings and how they're used + +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# Autogenerated string files, don't enforce certain styles on them +[sr.cs] + +dotnet_diagnostic.IDE0005.severity = none +dotnet_diagnostic.IDE0073.severity = none + +# C# files +[*.cs] + +dotnet_analyzer_diagnostic.severity = error + +# Errors flagged when this file was added. These should be +# investigated and either fixed or marked as acceptable with +# a reason why +dotnet_diagnostic.IDE0018.severity = none +dotnet_diagnostic.CA1829.severity = none +dotnet_diagnostic.CA1806.severity = none +dotnet_diagnostic.IDE0078.severity = none +dotnet_diagnostic.IDE0019.severity = none +dotnet_diagnostic.CA1309.severity = none +dotnet_diagnostic.CA2249.severity = none +dotnet_diagnostic.CA2251.severity = none +dotnet_diagnostic.CA1310.severity = none +dotnet_diagnostic.CA1305.severity = none +dotnet_diagnostic.CA1707.severity = none +dotnet_diagnostic.IDE0009.severity = none +dotnet_diagnostic.IDE0045.severity = none +dotnet_diagnostic.CA1304.severity = none +dotnet_diagnostic.IDE0002.severity = none +dotnet_diagnostic.CA2208.severity = none +dotnet_diagnostic.IDE0090.severity = none +dotnet_diagnostic.IDE0047.severity = none +dotnet_diagnostic.IDE0051.severity = none +dotnet_diagnostic.IDE1000.severity = none +dotnet_diagnostic.CA1834.severity = none +dotnet_diagnostic.IDE0066.severity = none +dotnet_diagnostic.IDE0007.severity = none +dotnet_diagnostic.IDE0008.severity = none +dotnet_diagnostic.IDE0055.severity = none +dotnet_diagnostic.IDE0044.severity = none +dotnet_diagnostic.IDE0057.severity = none +dotnet_diagnostic.CA2101.severity = none +dotnet_diagnostic.CA1068.severity = none +dotnet_diagnostic.CA1069.severity = none +dotnet_diagnostic.IDE0059.severity = none +dotnet_diagnostic.CA1010.severity = none +dotnet_diagnostic.CA1001.severity = none +dotnet_diagnostic.CA1036.severity = none +dotnet_diagnostic.CA5369.severity = none +dotnet_diagnostic.CA2245.severity = none +dotnet_diagnostic.CA1507.severity = none +dotnet_diagnostic.CA1845.severity = none +dotnet_diagnostic.IDE0025.severity = none +dotnet_diagnostic.xUnit2000.severity = none +dotnet_diagnostic.xUnit2012.severity = none +dotnet_diagnostic.xUnit1013.severity = none +dotnet_diagnostic.CA1711.severity = none +dotnet_diagnostic.IDE0027.severity = none +dotnet_diagnostic.IDE0021.severity = none +dotnet_diagnostic.CA1822.severity = none +dotnet_diagnostic.CA2201.severity = none +dotnet_diagnostic.CA1051.severity = none +dotnet_diagnostic.IDE0004.severity = none +dotnet_diagnostic.CA1838.severity = none +dotnet_diagnostic.IDE0075.severity = none +dotnet_diagnostic.CA1825.severity = none +dotnet_diagnostic.CA1816.severity = none +dotnet_diagnostic.CA1827.severity = none +dotnet_diagnostic.CA1720.severity = none +dotnet_diagnostic.CA1805.severity = none +dotnet_diagnostic.CA1725.severity = none +dotnet_diagnostic.CA2231.severity = none +dotnet_diagnostic.CA2016.severity = none +dotnet_diagnostic.CA1826.severity = none +dotnet_diagnostic.CA1835.severity = none +dotnet_diagnostic.CA1716.severity = none +dotnet_diagnostic.CA1708.severity = none +dotnet_diagnostic.CA1000.severity = none +dotnet_diagnostic.CA2211.severity = none +dotnet_diagnostic.CA1041.severity = none +dotnet_diagnostic.CA1715.severity = none +dotnet_diagnostic.IDE1006.severity = none +dotnet_diagnostic.CA1846.severity = none +dotnet_diagnostic.CA1847.severity = none +dotnet_diagnostic.CA1018.severity = none +dotnet_diagnostic.IDE0100.severity = none +dotnet_diagnostic.IDE0022.severity = none +dotnet_diagnostic.CA1841.severity = none +dotnet_diagnostic.CA2241.severity = none +dotnet_diagnostic.CA1436.severity = none +dotnet_diagnostic.CA2200.severity = none +dotnet_diagnostic.CA1836.severity = none +dotnet_diagnostic.IDE0028.severity = none +dotnet_diagnostic.IDE0032.severity = none +dotnet_diagnostic.IDE0065.severity = none +dotnet_diagnostic.IDE0120.severity = none +dotnet_diagnostic.IDE0130.severity = none +dotnet_diagnostic.IDE0017.severity = none +dotnet_diagnostic.IDE0010.severity = none +dotnet_diagnostic.IDE0052.severity = none +dotnet_diagnostic.IDE1005.severity = none +dotnet_diagnostic.IDE0040.severity = none +dotnet_diagnostic.IDE0034.severity = none +dotnet_diagnostic.IDE0063.severity = none +dotnet_diagnostic.IDE0049.severity = none +dotnet_diagnostic.IDE0001.severity = none +dotnet_diagnostic.IDE0039.severity = none +dotnet_diagnostic.IDE0054.severity = none +dotnet_diagnostic.IDE0060.severity = none +dotnet_diagnostic.IDE0048.severity = none +dotnet_diagnostic.IDE0030.severity = none +dotnet_diagnostic.IDE0031.severity = none +dotnet_diagnostic.IDE0016.severity = none +dotnet_diagnostic.IDE0036.severity = none +dotnet_diagnostic.IDE0029.severity = none +dotnet_diagnostic.IDE0076.severity = none +dotnet_diagnostic.IDE0070.severity = none +dotnet_diagnostic.IDE0011.severity = none +dotnet_diagnostic.IDE0056.severity = none +dotnet_diagnostic.IDE0082.severity = none +dotnet_diagnostic.IDE0071.severity = none +dotnet_diagnostic.IDE0083.severity = none +dotnet_diagnostic.IDE0041.severity = none +dotnet_diagnostic.IDE0150.severity = none +dotnet_diagnostic.IDE0020.severity = none +dotnet_diagnostic.IDE0061.severity = none +dotnet_diagnostic.IDE0062.severity = none + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +insert_final_newline = false + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +file_header_template = \nCopyright (c) Microsoft. All rights reserved.\nLicensed under the MIT license. See LICENSE file in the project root for full license information.\n + +# this. and Me. preferences +dotnet_style_qualification_for_event = true +dotnet_style_qualification_for_field = true +dotnet_style_qualification_for_method = true +dotnet_style_qualification_for_property = true + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all : error + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = true +dotnet_style_allow_statement_immediately_after_block_experimental = true + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = false +csharp_style_var_for_built_in_types = false +csharp_style_var_when_type_is_apparent = true + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = false +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = false +csharp_style_expression_bodied_methods = false +csharp_style_expression_bodied_operators = false +csharp_style_expression_bodied_properties = true + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async + +# Code-block preferences +csharp_prefer_braces = true +csharp_prefer_simple_using_statement = true + +# Expression-level preferences +csharp_prefer_simple_default_expression = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_pattern_local_over_anonymous_function = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_range_operator = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +# Disable IDE0058 since it causes a lot of noise/suppressions which doesn't seem worth it to have currently +dotnet_diagnostic.IDE0058.severity = silent +# csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true +csharp_style_allow_embedded_statements_on_same_line_experimental = true + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case diff --git a/Directory.Build.props b/Directory.Build.props index 0bbd4acb..64931656 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,5 +9,6 @@ net6.0 net6.0 win-x64;win-x86;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64;osx.10.11-x64;osx-x64;linux-x64 + true diff --git a/build.cake b/build.cake index 2628b995..00741346 100644 --- a/build.cake +++ b/build.cake @@ -230,7 +230,7 @@ Task("BuildTest") StandardOutputWriter = logWriter, StandardErrorWriter = logWriter }) - .ExceptionOnError($"Building test {project} failed for {framework}."); + .ExceptionOnError($"Building test {project} failed for {framework}. See {logPath} for more details."); } } diff --git a/src/Microsoft.InsightsGenerator/SigGen.cs b/src/Microsoft.InsightsGenerator/SigGen.cs index b3954712..7402b432 100644 --- a/src/Microsoft.InsightsGenerator/SigGen.cs +++ b/src/Microsoft.InsightsGenerator/SigGen.cs @@ -1,9 +1,11 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; -using System.Net.Sockets; -using System.Globalization; namespace Microsoft.InsightsGenerator { diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/CancelTokenKey.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/CancelTokenKey.cs index 5b046ad4..31cd987b 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/CancelTokenKey.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/CancelTokenKey.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/ConnectionManager.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/ConnectionManager.cs index ec477935..5e271e37 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/ConnectionManager.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/ConnectionManager.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Collections.Concurrent; using System.Composition; diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenParams.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenParams.cs index 6aae20f0..9ecc5a31 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenParams.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenParams.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts { public class RequestSecurityTokenParams diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenResponse.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenResponse.cs index c332beea..1e96a90b 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenResponse.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/RequestSecurityTokenResponse.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts { public class RequestSecurityTokenResponse diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs index a7c99316..eef73be6 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.SqlTools.Hosting.Protocol.Contracts; namespace Microsoft.Kusto.ServiceLayer.Connection.Contracts diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionManager.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionManager.cs index fdcdfd5b..3994278e 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionManager.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionManager.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.Connection { public interface IConnectionManager diff --git a/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionService.cs b/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionService.cs index 419621c7..587b9b96 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionService.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Connection/IConnectionService.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Threading.Tasks; using Microsoft.Kusto.ServiceLayer.Connection.Contracts; using Microsoft.Kusto.ServiceLayer.LanguageServices; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Contracts/DataSourceConnectionDetails.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Contracts/DataSourceConnectionDetails.cs index bb87987e..69a6bd4f 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Contracts/DataSourceConnectionDetails.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Contracts/DataSourceConnectionDetails.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Contracts { public class DataSourceConnectionDetails diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataReaderWrapper.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataReaderWrapper.cs index 3b508343..3ec3a6eb 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataReaderWrapper.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataReaderWrapper.cs @@ -1,6 +1,8 @@ -// -// Copyright (c) Microsoft. All Rights Reserved. -// +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Data; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceBase.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceBase.cs index 26bb1762..f88a66ac 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceBase.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceBase.cs @@ -1,6 +1,7 @@ -// -// Copyright (c) Microsoft. All Rights Reserved. -// +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceFactory.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceFactory.cs index 0683211d..3a3e337c 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceFactory.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceFactory.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Composition; using Kusto.Data; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceType.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceType.cs index 2688211d..c5789020 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceType.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/DataSourceType.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource { /// /// Represents the type of a data source. diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/DiagnosticsInfo.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/DiagnosticsInfo.cs index 2a567a20..c395f94f 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/DiagnosticsInfo.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/DiagnosticsInfo.cs @@ -1,4 +1,9 @@ -using System.Collections.Generic; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.Collections.Generic; namespace Microsoft.Kusto.ServiceLayer.DataSource { diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSource.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSource.cs index fe95e70b..65fd3337 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSource.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSource.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Data; using System.Threading; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSourceFactory.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSourceFactory.cs index 978f1ef4..aa8d2fe2 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSourceFactory.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/IDataSourceFactory.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.Connection.Contracts; namespace Microsoft.Kusto.ServiceLayer.DataSource diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/IntellisenseClientBase.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/IntellisenseClientBase.cs index 7108a2b7..14f29d20 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/IntellisenseClientBase.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/IntellisenseClientBase.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabaseSchemaResult.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabaseSchemaResult.cs index 6aecafc4..2a162ce0 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabaseSchemaResult.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabaseSchemaResult.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense { public class ShowDatabaseSchemaResult diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabasesResult.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabasesResult.cs index 75813c67..34d4ea6a 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabasesResult.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowDatabasesResult.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense { public class ShowDatabasesResult diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowFunctionsResult.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowFunctionsResult.cs index 72961ec4..de7a7c89 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowFunctionsResult.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Intellisense/ShowFunctionsResult.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Intellisense { public class ShowFunctionsResult diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/IKustoClient.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/IKustoClient.cs index 2cd2245f..3cb37d12 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/IKustoClient.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/IKustoClient.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Collections.Generic; using System.Data; using System.Threading; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoClient.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoClient.cs index e9c34ce6..660937b5 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoClient.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoClient.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Data; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoDataSource.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoDataSource.cs index 4bfc29e1..65e05c37 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoDataSource.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoDataSource.cs @@ -1,6 +1,7 @@ -// -// Copyright (c) Microsoft. All Rights Reserved. -// +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoIntellisenseClient.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoIntellisenseClient.cs index 38f9007d..7afeb25b 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoIntellisenseClient.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoIntellisenseClient.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoResultsReader.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoResultsReader.cs index e775692b..395936c3 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoResultsReader.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Kusto/KustoResultsReader.cs @@ -1,4 +1,9 @@ -using System.Collections.Generic; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.Collections.Generic; using System.Data; namespace Microsoft.Kusto.ServiceLayer.DataSource.Kusto diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoQueryUtils.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoQueryUtils.cs index a7d8da6e..2a8e30fa 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoQueryUtils.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/KustoQueryUtils.cs @@ -1,6 +1,8 @@ -// -// Copyright (c) Microsoft. All Rights Reserved. -// +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/ColumnMetadata.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/ColumnMetadata.cs index 183e9d1f..17addfb7 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/ColumnMetadata.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/ColumnMetadata.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { /// /// Column metadata information diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceMetadataType.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceMetadataType.cs index 097b0974..dcf4fa33 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceMetadataType.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceMetadataType.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { /// /// Metadata type enumeration diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceObjectMetadata.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceObjectMetadata.cs index 91be060f..f50055c4 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceObjectMetadata.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DataSourceObjectMetadata.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { /// /// Object metadata information diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DatabaseMetadata.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DatabaseMetadata.cs index 83bfaea6..2a1b90a0 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DatabaseMetadata.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/DatabaseMetadata.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { /// /// Database metadata information diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FolderMetadata.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FolderMetadata.cs index eabde584..2075ef1e 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FolderMetadata.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FolderMetadata.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { /// /// Folder metadata information diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FunctionMetadata.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FunctionMetadata.cs index f0134cf4..855aa73b 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FunctionMetadata.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/FunctionMetadata.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { public class FunctionMetadata : DatabaseMetadata { diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/MetadataFactory.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/MetadataFactory.cs index c4897aa5..a30adeb1 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/MetadataFactory.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/MetadataFactory.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using Microsoft.Kusto.ServiceLayer.Admin.Contracts; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/TableMetadata.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/TableMetadata.cs index 578e35cb..bfaff6db 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/TableMetadata.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Metadata/TableMetadata.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Metadata { /// /// Database metadata information diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/ColumnInfo.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/ColumnInfo.cs index 01514f42..e798559e 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/ColumnInfo.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/ColumnInfo.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Models +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Models { public class ColumnInfo { diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/FunctionInfo.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/FunctionInfo.cs index 9db9096a..aa633282 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/FunctionInfo.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/FunctionInfo.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Models +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Models { public class FunctionInfo { diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/TableInfo.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/TableInfo.cs index ad1c51f2..441a48d4 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/TableInfo.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Models/TableInfo.cs @@ -1,4 +1,9 @@ -namespace Microsoft.Kusto.ServiceLayer.DataSource.Models +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.Kusto.ServiceLayer.DataSource.Models { public class TableInfo { diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorClient.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorClient.cs index 300f095b..9e1ab835 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorClient.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorClient.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Net.Http; using System.Net.Http.Headers; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorDataSource.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorDataSource.cs index c2f88418..87b94384 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorDataSource.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorDataSource.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Data; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorExtensions.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorExtensions.cs index 15de0d56..0ad6f97f 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorExtensions.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorExtensions.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Data; using System.Linq; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorIntellisenseClient.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorIntellisenseClient.cs index 664a6e94..e20336cf 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorIntellisenseClient.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/MonitorIntellisenseClient.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Collections.Generic; using System.Linq; using Kusto.Language; diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/ColumnsModel.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/ColumnsModel.cs index 76edbf26..6fa097cf 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/ColumnsModel.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/ColumnsModel.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models { public class ColumnsModel diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TableGroupsModel.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TableGroupsModel.cs index 3a370d4e..63db74fa 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TableGroupsModel.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TableGroupsModel.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models { public class TableGroupsModel diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TablesModel.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TablesModel.cs index c4e671be..36518099 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TablesModel.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/TablesModel.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models { public class TablesModel diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/WorkspacesModel.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/WorkspacesModel.cs index 82d84909..b7253768 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/WorkspacesModel.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/Models/WorkspacesModel.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models { public class WorkspacesModel diff --git a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/WorkspaceResponse.cs b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/WorkspaceResponse.cs index fac43ac2..5cf8df33 100644 --- a/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/WorkspaceResponse.cs +++ b/src/Microsoft.Kusto.ServiceLayer/DataSource/Monitor/Responses/WorkspaceResponse.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses.Models; namespace Microsoft.Kusto.ServiceLayer.DataSource.Monitor.Responses diff --git a/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs b/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs index e92d8dfa..8b08e85c 100644 --- a/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs +++ b/src/Microsoft.Kusto.ServiceLayer/HostLoader.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading.Tasks; diff --git a/src/Microsoft.Kusto.ServiceLayer/LanguageServices/IConnectedBindingQueue.cs b/src/Microsoft.Kusto.ServiceLayer/LanguageServices/IConnectedBindingQueue.cs index 99b18950..5f462eaf 100644 --- a/src/Microsoft.Kusto.ServiceLayer/LanguageServices/IConnectedBindingQueue.cs +++ b/src/Microsoft.Kusto.ServiceLayer/LanguageServices/IConnectedBindingQueue.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Threading; using Microsoft.Kusto.ServiceLayer.Connection; diff --git a/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ObjectExplorerSession.cs b/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ObjectExplorerSession.cs index b0f510b7..c6238825 100644 --- a/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ObjectExplorerSession.cs +++ b/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ObjectExplorerSession.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.Connection; using Microsoft.Kusto.ServiceLayer.Connection.Contracts; using Microsoft.Kusto.ServiceLayer.DataSource; diff --git a/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ValidForFlag.cs b/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ValidForFlag.cs index 0d6f39e6..220a11df 100644 --- a/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ValidForFlag.cs +++ b/src/Microsoft.Kusto.ServiceLayer/ObjectExplorer/ValidForFlag.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Microsoft.Kusto.ServiceLayer/Program.cs b/src/Microsoft.Kusto.ServiceLayer/Program.cs index 9eda3d4a..a8cb8fda 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Program.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Program.cs @@ -1,6 +1,8 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using Microsoft.SqlTools.ServiceLayer.SqlContext; using Microsoft.Kusto.ServiceLayer.Utility; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Batch.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Batch.cs index 9950a28d..da117d50 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Batch.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Batch.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs index 0944c95e..35c4c34a 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs index db0e0234..988947ef 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.Hosting.Protocol.Contracts; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs index 628df5ab..b3a1b90a 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts.ExecuteRequests { diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs index 6f0f81da..0d62961d 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.Hosting.Protocol.Contracts; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs index 2bd3aa1b..39fe7455 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.Kusto.ServiceLayer.QueryExecution.Contracts { diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/SelectionData.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/SelectionData.cs index f8beb500..55f96ade 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/SelectionData.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/Contracts/SelectionData.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.Kusto.ServiceLayer.Workspace.Contracts; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultOnlyContext.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultOnlyContext.cs index 8ac0ecb2..09f2cb1e 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultOnlyContext.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultOnlyContext.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.Hosting.Protocol; using System.Threading.Tasks; diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultSet.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultSet.cs index 5af04b95..478475af 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultSet.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/ResultSet.cs @@ -1,5 +1,4 @@ -// -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // diff --git a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/SpecialAction.cs b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/SpecialAction.cs index 0fe7df0f..3e618bb2 100644 --- a/src/Microsoft.Kusto.ServiceLayer/QueryExecution/SpecialAction.cs +++ b/src/Microsoft.Kusto.ServiceLayer/QueryExecution/SpecialAction.cs @@ -1,6 +1,8 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; namespace Microsoft.Kusto.ServiceLayer.QueryExecution diff --git a/src/Microsoft.Kusto.ServiceLayer/Scripting/IScripter.cs b/src/Microsoft.Kusto.ServiceLayer/Scripting/IScripter.cs index 04f339a2..3422c071 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Scripting/IScripter.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Scripting/IScripter.cs @@ -1,4 +1,9 @@ -using Microsoft.Kusto.ServiceLayer.DataSource; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.Kusto.ServiceLayer.DataSource; using Microsoft.Kusto.ServiceLayer.Scripting.Contracts; using Microsoft.SqlServer.Management.Sdk.Sfc; diff --git a/src/Microsoft.Kusto.ServiceLayer/Utility/AccessTokenProvider.cs b/src/Microsoft.Kusto.ServiceLayer/Utility/AccessTokenProvider.cs index 3d20fda2..36e127b6 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Utility/AccessTokenProvider.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Utility/AccessTokenProvider.cs @@ -1,4 +1,9 @@ -using Microsoft.SqlServer.Dac; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.SqlServer.Dac; using System; namespace Microsoft.Kusto.ServiceLayer.Utility diff --git a/src/Microsoft.Kusto.ServiceLayer/Utility/ServiceLayerCommandOptions.cs b/src/Microsoft.Kusto.ServiceLayer/Utility/ServiceLayerCommandOptions.cs index af9aef8c..6ac02c70 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Utility/ServiceLayerCommandOptions.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Utility/ServiceLayerCommandOptions.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Globalization; using Microsoft.SqlTools.Hosting.Utility; diff --git a/src/Microsoft.Kusto.ServiceLayer/Utility/SystemExtensions.cs b/src/Microsoft.Kusto.ServiceLayer/Utility/SystemExtensions.cs index 47931c22..ce64f293 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Utility/SystemExtensions.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Utility/SystemExtensions.cs @@ -1,6 +1,7 @@ -// -// Copyright (c) Microsoft. All Rights Reserved. -// +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.Kusto.ServiceLayer.Utility { diff --git a/src/Microsoft.Kusto.ServiceLayer/Utility/ValidationUtils.cs b/src/Microsoft.Kusto.ServiceLayer/Utility/ValidationUtils.cs index 9efec38d..828bdc0c 100644 --- a/src/Microsoft.Kusto.ServiceLayer/Utility/ValidationUtils.cs +++ b/src/Microsoft.Kusto.ServiceLayer/Utility/ValidationUtils.cs @@ -1,6 +1,7 @@ -// -// Copyright (c) Microsoft. All Rights Reserved. -// +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.Kusto.ServiceLayer.Utility { diff --git a/src/Microsoft.SqlTools.Credentials/.editorconfig b/src/Microsoft.SqlTools.Credentials/.editorconfig new file mode 100644 index 00000000..64c0454f --- /dev/null +++ b/src/Microsoft.SqlTools.Credentials/.editorconfig @@ -0,0 +1,15 @@ +# See https://github.com/dotnet/roslyn-analyzers/blob/main/.editorconfig for an example on different settings and how they're used + +# Disable checking for correct header for this project - most of the code is borrowed from other projects +# which have different style guidelines +[*.cs] + +dotnet_diagnostic.IDE0073.severity = none + +[*] +indent_style = space +indent_size = 4 +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false \ No newline at end of file diff --git a/src/Microsoft.SqlTools.Hosting/Utility/AutoLock.cs b/src/Microsoft.SqlTools.Hosting/Utility/AutoLock.cs index 06dff105..285ce502 100644 --- a/src/Microsoft.SqlTools.Hosting/Utility/AutoLock.cs +++ b/src/Microsoft.SqlTools.Hosting/Utility/AutoLock.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading; diff --git a/src/Microsoft.SqlTools.Hosting/Utility/ConcurrentCache.cs b/src/Microsoft.SqlTools.Hosting/Utility/ConcurrentCache.cs index aace98f3..006b260c 100644 --- a/src/Microsoft.SqlTools.Hosting/Utility/ConcurrentCache.cs +++ b/src/Microsoft.SqlTools.Hosting/Utility/ConcurrentCache.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/ExecutionEngineCode/BatchDefinition.cs b/src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/ExecutionEngineCode/BatchDefinition.cs index f2d46c33..e675f426 100644 --- a/src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/ExecutionEngineCode/BatchDefinition.cs +++ b/src/Microsoft.SqlTools.ManagedBatchParser/BatchParser/ExecutionEngineCode/BatchDefinition.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ServiceLayer.BatchParser.ExecutionEngineCode { diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAccountManager.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAccountManager.cs index f35eb926..edb05473 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAccountManager.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAccountManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading.Tasks; @@ -9,11 +10,11 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility; namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { /// - /// An account manager has the information of currently logged in user and can authenticate the user + /// An account manager has the information of currently logged in user and can authenticate the user /// Implementing classes must add a /// to the class in order to be found by the extension manager, /// and to define the type and category supported - /// + /// public interface IAccountManager : IExportable { /// @@ -46,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication /// bool HasLoginDialog { - get; + get; } /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureAuthenticationManager.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureAuthenticationManager.cs index ed18238b..3be1b284 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureAuthenticationManager.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureAuthenticationManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Collections.Generic; using System.Threading.Tasks; @@ -8,7 +9,7 @@ using System.Threading.Tasks; namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { /// - /// Provides functionality to authenticate to Azure and discover associated accounts and subscriptions + /// Provides functionality to authenticate to Azure and discover associated accounts and subscriptions /// public interface IAzureAuthenticationManager : IAccountManager { @@ -38,6 +39,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication /// /// Stores the selected subscriptions given the ids /// - Task SetSelectedSubscriptionsAsync(IEnumerable subscriptionIds); + Task SetSelectedSubscriptionsAsync(IEnumerable subscriptionIds); } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionContext.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionContext.cs index 2384edcc..71d3ce7e 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionContext.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionContext.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionIdentifier.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionIdentifier.cs index 2fcb8056..1fb026d6 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionIdentifier.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureSubscriptionIdentifier.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; @@ -30,6 +31,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication string SubscriptionId { get; - } + } } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureTenant.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureTenant.cs index 917edcc7..b20d2f4e 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureTenant.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureTenant.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { @@ -16,7 +17,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { get; } - + /// /// Display ID /// @@ -24,6 +25,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { get; } - + } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccount.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccount.cs index eeebd9cc..ccd256d4 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccount.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccount.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountDisplayInfo.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountDisplayInfo.cs index d6dfab5d..d8924602 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountDisplayInfo.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountDisplayInfo.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountSubscriptionContext.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountSubscriptionContext.cs index 588096a0..166ab5b5 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountSubscriptionContext.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IAzureUserAccountSubscriptionContext.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; @@ -18,6 +19,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication IAzureUserAccount UserAccount { get; - } + } } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IUserAccount.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IUserAccount.cs index c1c5e497..93038f1e 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IUserAccount.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Authentication/IUserAccount.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { @@ -16,7 +17,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { get; } - + /// /// Returns true if user needs reauthentication /// @@ -24,6 +25,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication { get; } - + } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/AuthenticationService.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/AuthenticationService.cs index 5d6e1c31..a17fcd01 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/AuthenticationService.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/AuthenticationService.cs @@ -30,12 +30,12 @@ namespace Microsoft.SqlTools.ResourceProvider.Core public AuthenticationService() { } - + public override void InitializeService(IProtocolEndpoint serviceHost) { Logger.Write(TraceEventType.Verbose, "AuthenticationService initialized"); } - + public async Task SetCurrentAccountAsync(Account account, Dictionary securityTokenMappings) { var authManager = ServiceProvider.GetService(); diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/CommonUtil.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/CommonUtil.cs index f090c87b..cbdddf10 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/CommonUtil.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/CommonUtil.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; @@ -13,7 +14,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// public static class CommonUtil { - private const int KeyValueNameLength = 1024; // 1024 should be enough for registry key value name. + private const int KeyValueNameLength = 1024; // 1024 should be enough for registry key value name. //******************************************************************************************** /// @@ -44,7 +45,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core //******************************************************************************************** /// - /// Throw an exception if a string is null or empty. + /// Throw an exception if a string is null or empty. /// /// string to check /// the variable or parameter name to display @@ -97,6 +98,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core return message; } - + } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ConnectionConstants.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ConnectionConstants.cs index 478ae03f..edccc1e1 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ConnectionConstants.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ConnectionConstants.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core { diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExceptionUtil.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExceptionUtil.cs index 7bb250d7..ad6739c8 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExceptionUtil.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExceptionUtil.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Data.Common; @@ -18,7 +19,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// Returns true if given exception if any of the inner exceptions is UserNeedsAuthenticationException /// internal static bool IsUserNeedsReauthenticateException(this Exception ex) - { + { return ex.IsExceptionType(typeof(UserNeedsAuthenticationException)); } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExpiredTokenException.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExpiredTokenException.cs index c9e760c9..7c6f5d83 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExpiredTokenException.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ExpiredTokenException.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Runtime.Serialization; @@ -8,7 +9,7 @@ using System.Runtime.Serialization; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// The exception is used if any operation fails as a request failed due to an expired token + /// The exception is used if any operation fails as a request failed due to an expired token /// public class ExpiredTokenException : ServiceExceptionBase { @@ -29,11 +30,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } /// - /// Initializes a new instance of the ServiceFailedException class with a specified error message + /// Initializes a new instance of the ServiceFailedException class with a specified error message /// and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public ExpiredTokenException(string message, Exception innerException) : base(message, innerException) diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceExceptionBase.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceExceptionBase.cs index 7640c8b2..0b3bc40d 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceExceptionBase.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceExceptionBase.cs @@ -35,11 +35,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// /// The error message that explains the reason for the exception. /// The Http error code. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public ServiceExceptionBase(string message, HttpStatusCode httpStatusCode, Exception innerException = null) : this(message, (int)httpStatusCode, innerException) - { + { } /// @@ -47,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// /// The error message that explains the reason for the exception. /// The Http error code. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public ServiceExceptionBase(string message, int httpStatusCode, Exception innerException) : base(message, innerException) @@ -57,11 +57,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } /// - /// Initializes a new instance of the AuthenticationFailedException class with a specified error message + /// Initializes a new instance of the AuthenticationFailedException class with a specified error message /// and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified protected ServiceExceptionBase(string message, Exception innerException) : base(message, innerException) diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceFailedException.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceFailedException.cs index bbe98c7b..f5333020 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceFailedException.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/ServiceFailedException.cs @@ -32,11 +32,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } /// - /// Initializes a new instance of the ServiceFailedException class with a specified error message + /// Initializes a new instance of the ServiceFailedException class with a specified error message /// and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public ServiceFailedException(string message, Exception innerException) : base(message, innerException) @@ -54,13 +54,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } /// - /// Creates a new instance of ServiceFailedException by adding the server definition info to the given message + /// Creates a new instance of ServiceFailedException by adding the server definition info to the given message /// internal static ServiceFailedException CreateException(string message, ServerDefinition serverDefinition, Exception innerException) { return new ServiceFailedException( - string.Format(CultureInfo.CurrentCulture, message, - serverDefinition != null ? serverDefinition.ServerType : string.Empty, + string.Format(CultureInfo.CurrentCulture, message, + serverDefinition != null ? serverDefinition.ServerType : string.Empty, serverDefinition != null ? serverDefinition.Category : string.Empty), innerException); } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/UserNeedsAuthenticationException.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/UserNeedsAuthenticationException.cs index a3049e73..5feb43d8 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Common/UserNeedsAuthenticationException.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Common/UserNeedsAuthenticationException.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Runtime.Serialization; @@ -8,7 +9,7 @@ using System.Runtime.Serialization; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// The exception is used if any operation fails becauase user needs to reauthenticate + /// The exception is used if any operation fails becauase user needs to reauthenticate /// public class UserNeedsAuthenticationException : ServiceExceptionBase { @@ -29,11 +30,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } /// - /// Initializes a new instance of the ServiceFailedException class with a specified error message + /// Initializes a new instance of the ServiceFailedException class with a specified error message /// and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public UserNeedsAuthenticationException(string message, Exception innerException) : base(message, innerException) diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/Account.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/Account.cs index 1f0a4312..a1efd40b 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/Account.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/Account.cs @@ -68,13 +68,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts public class ProviderSettings { /// - /// Display name of the provider + /// Display name of the provider /// public string DisplayName; /// /// ID of the provider - /// + /// public string Id; /// /// Settings for the provider itself diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/FirewallRule.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/FirewallRule.cs index bebb4731..9e2557cf 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/FirewallRule.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Contracts/FirewallRule.cs @@ -28,7 +28,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts /// public Account Account { get; set; } /// - /// Per-tenant token mappings. Ideally would be set independently of this call, but for + /// Per-tenant token mappings. Ideally would be set independently of this call, but for /// now this allows us to get the tokens necessary to find a server and open a firewall rule /// public Dictionary SecurityTokenMappings { get; set; } @@ -47,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts /// End of the IP address range /// public string EndIpAddress { get; set; } - + } public class CreateFirewallRuleResponse : TokenReliantResponse @@ -61,7 +61,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts public class CanHandleFirewallRuleRequest { public static readonly - RequestType Type = + RequestType Type = RequestType.Create("resource/handleFirewallRule"); } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureDatabaseDiscoveryProvider.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureDatabaseDiscoveryProvider.cs index 7c823e6c..c971f9db 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureDatabaseDiscoveryProvider.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureDatabaseDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -16,8 +17,8 @@ using Microsoft.SqlTools.Utility; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// Default implementation for for Azure Sql databases. - /// A discovery provider capable of finding Sql Azure databases for a specific Azure user account. + /// Default implementation for for Azure Sql databases. + /// A discovery provider capable of finding Sql Azure databases for a specific Azure user account. /// [Exportable( @@ -35,7 +36,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core public AzureDatabaseDiscoveryProvider() { // Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor. - // The attribute is preserved in order to simplify ability to backport into existing tools + // The attribute is preserved in order to simplify ability to backport into existing tools Metadata = new ExportableMetadata( ServerTypes.SqlServer, Categories.Azure, @@ -90,9 +91,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } /// - /// Returns the databases for given connection info. + /// Returns the databases for given connection info. /// The connection info should be used to make the connection for getting databases not the account manager - /// + /// //public async Task> GetDatabaseInstancesAsync(UIConnectionInfo uiConnectionInfo, CancellationToken cancellationToken) //{ // ServiceResponse result = null; @@ -109,7 +110,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// /// Returns the databases for given server name. Using the account manager to get the databases - /// + /// public async Task> GetDatabaseInstancesAsync(string serverName, CancellationToken cancellationToken) { ServiceResponse result = null; @@ -120,7 +121,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core //if connection is passed, we need to search all subscriptions not selected ones IEnumerable subscriptions = await GetSubscriptionsAsync(string.IsNullOrEmpty(serverName)); if (!cancellationToken.IsCancellationRequested) - { + { result = await AzureUtil.ExecuteGetAzureResourceAsParallel((object)null, subscriptions, serverName, cancellationToken, GetDatabaseForSubscriptionAsync); } @@ -159,7 +160,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core get { return (_azureAccountManager = _azureAccountManager ?? GetService()); - } + } } /// @@ -206,11 +207,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// /// There was a wired nullReferencedException was running the tasks parallel. It only got fixed when I put the getting from cache insed an async method - /// + /// private Task> GetFromCacheAsync(string key) { return Task.Factory.StartNew(() => _cache.Get(key)); - } + } /// /// Returns a list of Azure sql databases for given subscription @@ -235,7 +236,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core else if (shouldFilter) { //we should filter the result because the cached data includes databases for all servers - result = new ServiceResponse(result.Data.Where(x => x.ServerInstanceInfo.FullyQualifiedDomainName == serverName), + result = new ServiceResponse(result.Data.Where(x => x.ServerInstanceInfo.FullyQualifiedDomainName == serverName), result.Errors); } @@ -243,7 +244,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core if (!shouldFilter && !cancellationToken.IsCancellationRequested) { result = _cache.UpdateCache(key, result); - } + } } catch (Exception ex) { @@ -261,7 +262,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core CancellationToken cancellationToken, CancellationToken internalCancellationToken) { ServiceResponse result = null; - + try { if (!cancellationToken.IsCancellationRequested && !internalCancellationToken.IsCancellationRequested) @@ -295,7 +296,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core return result ?? new ServiceResponse(); } - private async Task> GetDatabasesForSubscriptionServersAsync(IAzureResourceManagementSession session, + private async Task> GetDatabasesForSubscriptionServersAsync(IAzureResourceManagementSession session, IList filteredServersList, CancellationToken cancellationToken) { ServiceResponse result = null; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureServerDatabaseDiscoveryProvider.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureServerDatabaseDiscoveryProvider.cs index fac48b6a..a22db62d 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureServerDatabaseDiscoveryProvider.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureServerDatabaseDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -43,7 +44,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core result = await AzureUtil.ExecuteGetAzureResourceAsParallel(_session, serverResources, null, cancellationToken, GetDatabasesForServerFromService); } return result; - } + } private async Task> GetDatabasesForServerFromService( IAzureResourceManagementSession session, @@ -108,7 +109,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// /// Converts the resource to DatabaseInstanceInfo - /// + /// private DatabaseInstanceInfo ConvertToModel(ServerInstanceInfo serverInstanceInfo, IAzureResource azureResource) { DatabaseInstanceInfo databaseInstance = new DatabaseInstanceInfo(serverInstanceInfo) diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureSqlServerDiscoveryProvider.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureSqlServerDiscoveryProvider.cs index 79c9ae51..9e68435e 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureSqlServerDiscoveryProvider.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureSqlServerDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -12,11 +13,11 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// Default implementation for for Azure Sql servers. - /// A discovery provider capable of finding Sql Azure servers for a specific Azure user account. + /// Default implementation for for Azure Sql servers. + /// A discovery provider capable of finding Sql Azure servers for a specific Azure user account. /// [Exportable( - ServerTypes.SqlServer, + ServerTypes.SqlServer, Categories.Azure, typeof(IServerDiscoveryProvider), "Microsoft.SqlServer.ConnectionServices.Azure.AzureServerDiscoveryProvider")] @@ -28,7 +29,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core public AzureSqlServerDiscoveryProvider() { // Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor. - // The attribute is preserved in order to simplify ability to backport into existing tools + // The attribute is preserved in order to simplify ability to backport into existing tools Metadata = new ExportableMetadata( ServerTypes.SqlServer, Categories.Azure, @@ -120,6 +121,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core { _azureAccountManager = value as IAzureAuthenticationManager; } - } + } } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureUtil.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureUtil.cs index 3d7324ec..17ba23eb 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureUtil.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/AzureUtil.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInfoEventArgs.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInfoEventArgs.cs index fb3cf1b0..004ada1a 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInfoEventArgs.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInfoEventArgs.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInstanceInfo.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInstanceInfo.cs index 43e2e1e7..90865672 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInstanceInfo.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/DatabaseInstanceInfo.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; @@ -12,7 +13,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core public class DatabaseInstanceInfo { /// - /// Default constructor to initialize the instance + /// Default constructor to initialize the instance /// /// public DatabaseInstanceInfo(ServerInstanceInfo serverInstanceInfo) @@ -34,7 +35,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// public ServerInstanceInfo ServerInstanceInfo { - get; + get; private set; } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResource.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResource.cs index 84a3c1c2..d324d90f 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResource.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResource.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core { diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManagementSession.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManagementSession.cs index 529b8991..44a92c34 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManagementSession.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManagementSession.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.SqlTools.ResourceProvider.Core.Authentication; @@ -11,7 +12,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// A session used by . Includes all the clients that the resource management needs to get ther resources /// public interface IAzureResourceManagementSession : IDisposable - { + { /// /// Closes the session /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManager.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManager.cs index 3940392e..d2e5dff3 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManager.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureResourceManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Collections.Generic; using System.Threading.Tasks; @@ -24,7 +25,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// The list of databases Task> GetAzureDatabasesAsync( IAzureResourceManagementSession azureResourceManagementSession, - string resourceGroupName, + string resourceGroupName, string serverName); /// @@ -43,8 +44,8 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// Firewall rule request including the name and IP address range /// Task CreateFirewallRuleAsync( - IAzureResourceManagementSession azureResourceManagementSession, - IAzureSqlServerResource azureSqlServer, + IAzureResourceManagementSession azureResourceManagementSession, + IAzureSqlServerResource azureSqlServer, FirewallRuleRequest firewallRuleRequest ); @@ -52,7 +53,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// - /// Gets all subscription contexts under a specific user account. Queries all tenants for the account and uses these to log in + /// Gets all subscription contexts under a specific user account. Queries all tenants for the account and uses these to log in /// and retrieve subscription information as needed /// Account whose subscriptions should be queried /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureSqlServerResource.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureSqlServerResource.cs index 0c5e192e..1158fb31 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureSqlServerResource.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IAzureSqlServerResource.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core { @@ -11,7 +12,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core { /// /// Fully qualified domain name - /// + /// string FullyQualifiedDomainName { get; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ICacheable.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ICacheable.cs index 3cc2869b..484268ea 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ICacheable.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ICacheable.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Threading; using System.Threading.Tasks; @@ -8,10 +9,10 @@ using System.Threading.Tasks; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// Defines a class as cachable - /// + /// Defines a class as cachable + /// public interface ICacheable - { + { /// /// Clears the cache for current user /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IDatabaseDiscoveryProvider.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IDatabaseDiscoveryProvider.cs index 6d8df6b6..05600902 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IDatabaseDiscoveryProvider.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IDatabaseDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -11,23 +12,23 @@ using Microsoft.SqlTools.ResourceProvider.Core.Extensibility; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// A discovery provider capable of finding databases for a given server type and category. - /// For example: finding SQL Server databases in Azure, or on the local network. - /// Implementing classes must add a - /// to the class in order to be found by the extension manager, + /// A discovery provider capable of finding databases for a given server type and category. + /// For example: finding SQL Server databases in Azure, or on the local network. + /// Implementing classes must add a + /// to the class in order to be found by the extension manager, /// and to define the type and category supported /// public interface IDatabaseDiscoveryProvider : IExportable { /// - /// Returns the databases for given server name. - /// + /// Returns the databases for given server name. + /// Task> GetDatabaseInstancesAsync(string serverName, CancellationToken cancellationToken); /// - /// Returns the databases for given connection info. + /// Returns the databases for given connection info. /// The connection info should be used to make the connection for getting databases not the account manager - /// + /// //Task> GetDatabaseInstancesAsync(UIConnectionInfo uiConnectionInfo, CancellationToken cancellationToken); /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ISecureService.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ISecureService.cs index 4e2df4fd..9972351f 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ISecureService.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ISecureService.cs @@ -1,14 +1,15 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ResourceProvider.Core.Authentication; namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// Defines a class as secure which requires an account to function - /// + /// Defines a class as secure which requires an account to function + /// public interface ISecureService { /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IServerDiscoveryProvider.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IServerDiscoveryProvider.cs index db0c5712..06090465 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IServerDiscoveryProvider.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/IServerDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Collections.Generic; using System.Threading.Tasks; @@ -14,12 +15,12 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// Implementing classes must add a /// to the class in order to be found by the extension manager, /// and to define the type and category supported - /// + /// public interface IServerDiscoveryProvider : IExportable - { + { /// /// Discovers the server instances /// - Task> GetServerInstancesAsync(); + Task> GetServerInstancesAsync(); } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerDefinition.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerDefinition.cs index 7d7defe7..4ce02415 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerDefinition.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerDefinition.cs @@ -1,20 +1,21 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// Defines a server grouping based on the type of server connection supported (SQL Server, Reporting Server, Analysis Server) - /// and a Category by which these should be shown to the user. - /// Built in examples of categories include Local, Network, and Azure and additional categories can be defined as needed. - /// Note that the Connection Dialog UI may require Category to be set for some resource types such as. + /// Defines a server grouping based on the type of server connection supported (SQL Server, Reporting Server, Analysis Server) + /// and a Category by which these should be shown to the user. + /// Built in examples of categories include Local, Network, and Azure and additional categories can be defined as needed. + /// Note that the Connection Dialog UI may require Category to be set for some resource types such as. /// In addition a UI section matching that category may be required, or else the provider will not be used by any UI part and never be called. /// public interface IServerDefinition { /// - /// Category by which resources can be grouped. Built in examples of categories include Local, Network, and Azure and additional categories can be defined as needed. + /// Category by which resources can be grouped. Built in examples of categories include Local, Network, and Azure and additional categories can be defined as needed. /// string Category { diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerInstanceInfo.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerInstanceInfo.cs index 5f66ae91..02835715 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerInstanceInfo.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerInstanceInfo.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core { @@ -18,12 +19,12 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } public ServerInstanceInfo() - { + { } public IServerDefinition ServerDefinition { - get; private set; + get; private set; } /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerTypes.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerTypes.cs index cbdc626a..8992fefb 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerTypes.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServerTypes.cs @@ -1,14 +1,15 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core { /// - /// List of built-in server types used in . + /// List of built-in server types used in . /// Defines a server grouping based on the type of server connection supported (SQL Server, Reporting Server, Analysis Server) /// Additional server types can be defined as needed. - /// Note that the Connection Dialog UI may require server type to be set for some resource types such as. + /// Note that the Connection Dialog UI may require server type to be set for some resource types such as. /// In addition a UI section matching that category may be required, or else the provider will not be used by any UI part and never be called. /// public static class ServerTypes @@ -38,7 +39,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// List of built-in categories used in /// Defines a server grouping based on the category of server connection supported (Network, Local, Azure) /// Additional categories can be defined as needed. - /// Note that the Connection Dialog UI may require Category to be set for some resource types such as. + /// Note that the Connection Dialog UI may require Category to be set for some resource types such as. /// In addition a UI section matching that category may be required, or else the provider will not be used by any UI part and never be called. /// public static class Categories diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServiceResponse.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServiceResponse.cs index 15619311..9d93fd41 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServiceResponse.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Discovery/ServiceResponse.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -27,14 +28,14 @@ namespace Microsoft.SqlTools.ResourceProvider.Core /// Creates new instance given errors /// public ServiceResponse(IEnumerable errors) : this(Enumerable.Empty(), errors) - { + { } /// /// Creates new instance given data /// public ServiceResponse(IEnumerable data) : this(data, Enumerable.Empty()) - { + { } /// @@ -83,7 +84,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } return message; } - } + } /// /// Returns true if a response already found. it's used when we need to filter the responses diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableAttribute.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableAttribute.cs index e2bf82d5..03b2e89a 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableAttribute.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableAttribute.cs @@ -10,7 +10,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility { /// /// Attribute defining a service export, and the metadata about that service. Implements IServiceMetadata, - /// which should be used on the importer side to ensure type consistency. Services and providers have to add this property + /// which should be used on the importer side to ensure type consistency. Services and providers have to add this property /// in order to be found by the extension manager /// [MetadataAttribute] @@ -27,11 +27,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// The priority of the exportable. The extension manager will pick the exportable with the highest priority if multiple found /// The display name of the exportable. This field is optional public ExportableAttribute( - string serverType, + string serverType, string category, - Type type, - string id, - int priority = 0, + Type type, + string id, + int priority = 0, string displayName = null) : base(type) { Category = category; @@ -40,7 +40,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility DisplayName = displayName; Priority = priority; } - + /// /// The constructor to define an exportable by type, id and priority only. To be used by the exportables that support all server types and categories. /// For example: the implementation of can be used for all server types and categories. @@ -60,8 +60,8 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public string Category { - get; - private set; + get; + private set; } /// @@ -69,8 +69,8 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public string ServerType { - get; - private set; + get; + private set; } /// @@ -87,7 +87,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public string Id { - get; + get; private set; } @@ -96,7 +96,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public string DisplayName { - get; + get; private set; } @@ -105,7 +105,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public int Priority { - get; + get; private set; } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableBase.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableBase.cs index 253e45cb..93eda94b 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableBase.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableBase.cs @@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public IExportableMetadata Metadata { - get; + get; set; } @@ -36,7 +36,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public IMultiServiceProvider ServiceProvider { - get; + get; private set; } @@ -53,7 +53,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// A service of type T or null if not found protected T GetService() where T : IExportable - { + { return GetService(Metadata); } @@ -90,7 +90,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility } /// - /// ServerDefinition created from the metadata + /// ServerDefinition created from the metadata /// protected ServerDefinition ServerDefinition { diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableStatus.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableStatus.cs index 1521e5cc..10121032 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableStatus.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExportableStatus.cs @@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility public string ErrorMessage { get; set; } /// - /// An info link to navigate to + /// An info link to navigate to /// public string InfoLink { get; set; } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExtensionUtils.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExtensionUtils.cs index 163c49e4..170f3aba 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExtensionUtils.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ExtensionUtils.cs @@ -11,7 +11,7 @@ using Microsoft.SqlTools.Extensibility; namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility { /// - /// Extension methods for exportable and service + /// Extension methods for exportable and service /// public static class ExtensionUtils { @@ -48,14 +48,14 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility { return null; } - //Get all the possible matches + //Get all the possible matches IEnumerable allMatched = serverDefinition != null ? exportables.Where(x => Match(x.Metadata, serverDefinition)).ToList() : exportables; IList list = allMatched.ToList(); //If specific server type requested and the list has any item with that server type remove the others. //for instance is there's server for all server types and one specifically for sql and give metadata is asking for sql then - //we should return the sql one even if the other service has higher priority + //we should return the sql one even if the other service has higher priority IList withSameServerType = list.Where(x => serverDefinition.HasSameServerName(x.Metadata)).ToList(); if (withSameServerType.Any()) @@ -101,7 +101,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility } return false; } - + internal static string GetServerDefinitionKey(this IServerDefinition serverDefinition) { string key = string.Empty; @@ -126,7 +126,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility } return false; } - + internal static bool EmptyOrEqual(this string value1, string value2) { if (string.IsNullOrEmpty(value1) && string.IsNullOrEmpty(value2)) @@ -143,12 +143,12 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// /// Returns true if the metadata matches the given server definition - /// + /// public static bool Match(this IServerDefinition first, IServerDefinition other) { if (first == null) { - // TODO should we handle this differently? + // TODO should we handle this differently? return false; } if (other == null) @@ -158,10 +158,10 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility return MatchMetaData(first.ServerType, other.ServerType) && MatchMetaData(first.Category, other.Category); } - + /// /// Returns true if the metadata value matches the given value - /// + /// private static bool MatchMetaData(string metaData, string requestedMetaData) { if (string.IsNullOrEmpty(metaData) || string.IsNullOrEmpty(requestedMetaData)) diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/IExportable.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/IExportable.cs index 807e1d4d..4871acb9 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/IExportable.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/IExportable.cs @@ -19,7 +19,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility { set; get; } - + /// /// Returns the status of the exportable /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ITrace.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ITrace.cs index a03cab6f..df633724 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ITrace.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/ITrace.cs @@ -13,7 +13,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// Provides facility to trace code execution through calls to Trace* methods. /// Implementing classes must add a /// to the class in order to be found by the extension manager - /// + /// public interface ITrace : IExportable { /// @@ -40,5 +40,5 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility bool TraceException(TraceEventType eventType, int traceId, Exception exception, string message, [CallerLineNumber] int lineNumber = 0, [CallerFilePath] string fileName = "", [CallerMemberName] string memberName = ""); - } + } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceId.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceId.cs index 28dee2b8..1ceef648 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceId.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceId.cs @@ -66,7 +66,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// /// Trace Id for network browse traces /// - NetworkSection = 11, + NetworkSection = 11, /// /// Trace Id for main dialog traces diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceableBase.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceableBase.cs index 8eb9046d..e6429902 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceableBase.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Extensibility/TraceableBase.cs @@ -19,13 +19,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// public abstract ITrace Trace { - get; + get; set; } /// /// Write a trace event message to the underlying trace source. - /// + /// public bool TraceEvent(TraceEventType eventType, TraceId traceId, string format, params object[] args) { return TraceEvent(eventType, (int)traceId, format, args); @@ -33,16 +33,16 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// /// Write a trace event message to the underlying trace source. - /// + /// public bool TraceEvent(TraceEventType eventType, int traceId, string format, params object[] args) { return SafeTrace(eventType, traceId, format, args); - } + } /// /// Write a formatted trace event message to the underlying trace source and issue a Debug.Fail() call /// if condition is false. - /// + /// public bool AssertTraceEvent(bool condition, TraceEventType eventType, TraceId traceId, string message) { return AssertTraceEvent(condition, eventType, (int)traceId, message); @@ -51,7 +51,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// /// Write a formatted trace event message to the underlying trace source and issue a Debug.Fail() call /// if condition is false. - /// + /// public bool AssertTraceEvent(bool condition, TraceEventType eventType, int traceId, string message) { if (!condition) @@ -129,7 +129,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility return DebugTraceException(eventType, traceId, exception, message); } return true; - } + } /// /// Write a trace event with a message and exception details to the underlying trace source and issue a @@ -195,7 +195,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// /// Verifies ITrace instance is not null before tracing - /// + /// private bool SafeTrace(TraceEventType eventType, int traceId, string format, params object[] args) { if (Trace != null) @@ -207,7 +207,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Extensibility /// /// Verifies ITrace instance is not null before tracing the exception - /// + /// private bool SafeTraceException(TraceEventType eventType, int traceId, Exception exception, string message, [CallerLineNumber] int lineNumber = 0, [CallerFilePath] string fileName = "", [CallerMemberName] string memberName = "") diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallErrorParser.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallErrorParser.cs index de49255e..c30e3279 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallErrorParser.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallErrorParser.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.Data.SqlClient; @@ -12,15 +13,15 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall internal interface IFirewallErrorParser { /// - /// Parses given error message and error code to see if it's firewall rule error + /// Parses given error message and error code to see if it's firewall rule error /// and finds the blocked ip address /// FirewallParserResponse ParseErrorMessage(string errorMessage, int errorCode); /// - /// Parses given error message and error code to see if it's firewall rule error + /// Parses given error message and error code to see if it's firewall rule error /// and finds the blocked ip address - /// + /// FirewallParserResponse ParseException(SqlException sqlException); } @@ -30,9 +31,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall public class FirewallErrorParser : IFirewallErrorParser { /// - /// Parses given error message and error code to see if it's firewall rule error + /// Parses given error message and error code to see if it's firewall rule error /// and finds the blocked ip address - /// + /// public FirewallParserResponse ParseException(SqlException sqlException) { CommonUtil.CheckForNull(sqlException, "sqlException"); @@ -40,9 +41,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall } /// - /// Parses given error message and error code to see if it's firewall rule error + /// Parses given error message and error code to see if it's firewall rule error /// and finds the blocked ip address - /// + /// public FirewallParserResponse ParseErrorMessage(string errorMessage, int errorCode) { CommonUtil.CheckForNull(errorMessage, "errorMessage"); @@ -62,7 +63,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// Parses the given message to find the blocked ip address - /// + /// private static bool TryParseClientIp(string message, out IPAddress clientIp) { clientIp = null; @@ -91,7 +92,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// Returns true if given error code is firewall rule blocked error code - /// + /// private bool IsSqlAzureFirewallBlocked(int errorCode) { return errorCode == SqlAzureFirewallBlockedErrorNumber; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallParserResponse.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallParserResponse.cs index de422ebe..946be7d4 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallParserResponse.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallParserResponse.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Net; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleException.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleException.cs index 420600b3..90a7d647 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleException.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleException.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Net; @@ -34,7 +35,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// The error message that explains the reason for the exception. /// The Http error code. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public FirewallRuleException(string message, HttpStatusCode httpStatusCode, Exception innerException = null) : base(message, httpStatusCode, innerException) @@ -46,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// The error message that explains the reason for the exception. /// The Http error code. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public FirewallRuleException(string message, int httpStatusCode, Exception innerException = null) : base(message, httpStatusCode, innerException) @@ -55,11 +56,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall } /// - /// Initializes a new instance of the AuthenticationFailedException class with a specified error message + /// Initializes a new instance of the AuthenticationFailedException class with a specified error message /// and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public FirewallRuleException(string message, Exception innerException) : base(message, innerException) diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleRequest.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleRequest.cs index ee87e991..0c8ab9d9 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleRequest.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleRequest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Globalization; @@ -12,7 +13,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// Includes all the information needed to create a firewall rule /// public class FirewallRuleRequest - { + { /// /// Start IP address /// @@ -21,7 +22,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// End IP address /// - public IPAddress EndIpAddress { get; set; } + public IPAddress EndIpAddress { get; set; } /// /// Firewall rule name diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResource.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResource.cs index 97daa029..ee1678ab 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResource.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResource.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ResourceProvider.Core.Authentication; @@ -20,7 +21,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// Azure Subscription /// public IAzureUserAccountSubscriptionContext SubscriptionContext { get; set; } - + /// /// Returns true if the resource and subscription are not null diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResponse.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResponse.cs index f5922899..a6f48612 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResponse.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleResponse.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall { diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleService.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleService.cs index f9714bab..3e1229ee 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleService.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/Firewall/FirewallRuleService.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -19,13 +20,13 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall { /// /// Creates firewall rule for given server name and IP address range. Throws exception if operation fails - /// + /// Task CreateFirewallRuleAsync(string serverName, string startIpAddressValue, string endIpAddressValue); /// /// Creates firewall rule for given server name and IP address range. Throws exception if operation fails - /// + /// Task CreateFirewallRuleAsync(string serverName, IPAddress startIpAddress, IPAddress endIpAddress); @@ -53,7 +54,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall { /// /// Creates firewall rule for given server name and IP address range. Throws exception if operation fails - /// + /// public async Task CreateFirewallRuleAsync(string serverName, string startIpAddressValue, string endIpAddressValue) { IPAddress startIpAddress = ConvertToIpAddress(startIpAddressValue); @@ -63,7 +64,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// Creates firewall rule for given server name and IP address range. Throws exception if operation fails - /// + /// public async Task CreateFirewallRuleAsync(string serverName, IPAddress startIpAddress, IPAddress endIpAddress) { try @@ -87,7 +88,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall return firewallRuleResponse; } catch (ServiceExceptionBase) - { + { throw; } catch (Exception ex) @@ -108,7 +109,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// Creates firewall rule for given subscription and IP address range - /// + /// private async Task CreateFirewallRule(FirewallRuleResource firewallRuleResource, IPAddress startIpAddress, IPAddress endIpAddress) { CommonUtil.CheckForNull(firewallRuleResource, "firewallRuleResource"); @@ -135,7 +136,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall catch (ServiceExceptionBase) { throw; - } + } catch (Exception ex) { throw new FirewallRuleException(string.Format(CultureInfo.CurrentCulture, SR.FirewallRuleCreationFailedWithError, ex.Message), ex); @@ -161,9 +162,9 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall throw new FirewallRuleException(SR.NoSubscriptionsFound); } - ServiceResponse response = await AzureUtil.ExecuteGetAzureResourceAsParallel((object)null, + ServiceResponse response = await AzureUtil.ExecuteGetAzureResourceAsParallel((object)null, subscriptions, serverName, new CancellationToken(), TryFindAzureResourceForSubscriptionAsync); - + if (response != null) { if (response.Data != null && response.Data.Any()) @@ -190,7 +191,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall throw new FirewallRuleException(SR.FirewallRuleCreationFailed, ex); } } - + /// /// Returns a list of Azure sql databases for given subscription /// @@ -222,7 +223,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall /// /// Throws a firewallRule exception based on give status code /// - private void HandleError(ServiceExceptionBase exception, string serverName, + private void HandleError(ServiceExceptionBase exception, string serverName, IAzureUserAccountSubscriptionContext subscription) { var accountName = subscription != null && subscription.UserAccount != null && @@ -262,19 +263,19 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Firewall { return resource; } - } + } } catch (ServiceExceptionBase ex) { HandleError(ex, serverName, session.SubscriptionContext); - } + } catch (Exception ex) { throw new FirewallRuleException(SR.FirewallRuleCreationFailed, ex); - } + } return null; } - + private IPAddress ConvertToIpAddress(string ipAddressValue) { IPAddress ipAddress; diff --git a/src/Microsoft.SqlTools.ResourceProvider.Core/ResourceProviderService.cs b/src/Microsoft.SqlTools.ResourceProvider.Core/ResourceProviderService.cs index f4d0cb5a..2ba7e7e2 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.Core/ResourceProviderService.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.Core/ResourceProviderService.cs @@ -30,7 +30,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core public ResourceProviderService() { } - + public override void InitializeService(IProtocolEndpoint serviceHost) { Logger.Write(TraceEventType.Verbose, "ResourceProvider initialized"); @@ -43,7 +43,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core ResourceManager = ServiceProvider.GetService() }; } - + /// /// Handles a firewall rule creation request. It does this by matching the server name to an Azure Server resource, /// then issuing the command to create a new firewall rule for the specified IP address against that instance @@ -88,7 +88,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core } return result; } - + public async Task ProcessHandleFirewallRuleRequest(HandleFirewallRuleParams canHandleRuleParams, RequestContext requestContext) { Func> requestHandler = () => @@ -110,7 +110,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core }; await HandleRequest(requestHandler, null, requestContext, "HandleCreateFirewallRuleRequest"); } - + private async Task HandleRequest(Func> handler, Func expiredTokenHandler, RequestContext requestContext, string requestType) { Logger.Write(TraceEventType.Verbose, requestType); @@ -140,6 +140,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core // Send just the error message back for now as stack trace isn't useful await requestContext.SendError(ex.Message); } - } + } } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureAuthenticationManager.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureAuthenticationManager.cs index 1509fcfd..acf7d464 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureAuthenticationManager.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureAuthenticationManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -17,7 +18,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl { /// - /// Implementation for . + /// Implementation for . /// Provides functionality to authenticate to Azure and discover associated accounts and subscriptions /// [Exportable( @@ -79,7 +80,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl OnCurrentAccountChanged(); return await GetCurrentAccountAsync(); } - + /// /// Public for testing purposes. Creates an Azure account with the correct set of mappings for tenants etc. /// @@ -185,7 +186,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl { return _selectedSubscriptions ?? await GetSubscriptionsAsync(); } - + /// /// Returns user's subscriptions /// @@ -219,7 +220,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl private async Task> GetSubscriptionsFromCacheAsync(AzureUserAccount user) { var result = Enumerable.Empty(); - + if (user != null) { if (user.UniqueId != "") { @@ -278,7 +279,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl ? subscriptionList : subscriptionList.Where(x => subscriptionIds.Contains(x.Subscription.SubscriptionId)).ToList(); - //If the current account changes during setting selected subscription, none of the ids should be found + //If the current account changes during setting selected subscription, none of the ids should be found //so we just reset the selected subscriptions if (subscriptionIds != null && subscriptionIds.Any() && newSelectedSubscriptions.Count == 0) { diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceFailedException.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceFailedException.cs index 0a4882ba..c288cc67 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceFailedException.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceFailedException.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Net; @@ -35,7 +36,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl /// /// The error message that explains the reason for the exception. /// The Http error code. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public AzureResourceFailedException(string message, HttpStatusCode httpStatusCode, Exception innerException = null) : base(message, httpStatusCode, innerException) @@ -47,20 +48,20 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl /// /// The error message that explains the reason for the exception. /// The Http error code. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public AzureResourceFailedException(string message, int httpStatusCode, Exception innerException = null) : base(message, httpStatusCode, innerException) { - + } /// - /// Initializes a new instance of the AuthenticationFailedException class with a specified error message + /// Initializes a new instance of the AuthenticationFailedException class with a specified error message /// and a reference to the inner exception that is the cause of this exception. /// /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception, or a null reference + /// The exception that is the cause of the current exception, or a null reference /// (Nothing in Visual Basic) if no inner exception is specified public AzureResourceFailedException(string message, Exception innerException) : base(message, innerException) diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManagementSession.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManagementSession.cs index 4d5a30c0..1e33fe0a 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManagementSession.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManagementSession.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.Azure.Management.ResourceManager; @@ -11,7 +12,7 @@ using Microsoft.SqlTools.ResourceProvider.Core.Authentication; namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl { /// - /// VS session used by . + /// VS session used by . /// Includes all the clients that the resource management needs to get ther resources /// public class AzureResourceManagementSession : IAzureResourceManagementSession @@ -22,7 +23,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl /// Sql Management Client /// Resource Management Client /// Subscription Context - public AzureResourceManagementSession(SqlManagementClient sqlManagementClient, + public AzureResourceManagementSession(SqlManagementClient sqlManagementClient, ResourceManagementClient resourceManagementClient, IAzureUserAccountSubscriptionContext subscriptionContext) { @@ -46,7 +47,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl public bool CloseSession() { try - { + { if (ResourceManagementClient != null) { ResourceManagementClient.Dispose(); diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManager.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManager.cs index 32ec7e3d..5725832f 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManager.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -43,7 +44,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl public AzureResourceManager() { // Duplicate the exportable attribute as at present we do not support filtering using extensiondescriptor. - // The attribute is preserved in order to simplify ability to backport into existing tools + // The attribute is preserved in order to simplify ability to backport into existing tools Metadata = new ExportableMetadata( ServerTypes.SqlServer, Categories.Azure, @@ -222,7 +223,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl } /// - /// Gets all subscription contexts under a specific user account. Queries all tenants for the account and uses these to log in + /// Gets all subscription contexts under a specific user account. Queries all tenants for the account and uses these to log in /// and retrieve subscription information as needed /// public async Task> GetSubscriptionContextsAsync(IAzureUserAccount userAccount) diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceWrapper.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceWrapper.cs index 8943dcf9..5819127d 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceWrapper.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureResourceWrapper.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.Azure.Management.Sql.Models; @@ -9,7 +10,7 @@ using Microsoft.SqlTools.ResourceProvider.Core; namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl { /// - /// Implementation for using VS services. + /// Implementation for using VS services. /// Provides information about an Azure resource /// public class AzureResourceWrapper : IAzureResource @@ -18,7 +19,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl private string resourceGroupName; /// - /// Initializes the resource + /// Initializes the resource /// public AzureResourceWrapper(TrackedResource azureResource) { @@ -94,7 +95,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl if (!string.IsNullOrEmpty(Id)) { string[] idParts = Id.Split('/'); - + // Look for the "resourceGroups" section and return the section after this, hence // always stop before idParts.Length - 1 for (int i = 0; i < idParts.Length - 1; i++) @@ -134,5 +135,5 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl get; set; } - } + } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionContext.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionContext.cs index d2a9dc00..ed7329e9 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionContext.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionContext.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ResourceProvider.Core.Authentication; @@ -48,7 +49,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl { get { - return _azureSubscriptionIdentifier != null ? + return _azureSubscriptionIdentifier != null ? _azureSubscriptionIdentifier.SubscriptionId : string.Empty; } } diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionIdentifier.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionIdentifier.cs index 997ca9ba..d653df04 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionIdentifier.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureSubscriptionIdentifier.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.SqlTools.ResourceProvider.Core; @@ -31,7 +32,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl public bool Equals(IAzureSubscriptionIdentifier other) { return other != null && - CommonUtil.SameString(SubscriptionId, other.SubscriptionId) && + CommonUtil.SameString(SubscriptionId, other.SubscriptionId) && CommonUtil.SameUri(ServiceManagementEndpoint, other.ServiceManagementEndpoint); } @@ -58,7 +59,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl get; private set; } - + /// /// The ID of the tenant this subscription comes from /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureTenant.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureTenant.cs index e20b2a6b..97b16064 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureTenant.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureTenant.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -27,7 +28,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl set; } - + /// /// URI defining the root for resource lookup /// @@ -35,7 +36,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl /// - /// Access token for use in login scenarios. Note that we could consider implementing this better in the + /// Access token for use in login scenarios. Note that we could consider implementing this better in the /// public string AccessToken { @@ -44,7 +45,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl } /// - /// Optional token type defining whether this is a Bearer token or other type of token + /// Optional token type defining whether this is a Bearer token or other type of token /// public string TokenType { diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccount.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccount.cs index 774a5fd0..11ebdff0 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccount.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccount.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; @@ -53,7 +54,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl CommonUtil.SameString(other.TenantId, TenantId); // TODO probably should check the AllTenants field } - + /// /// Unique Id /// @@ -68,7 +69,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl this.uniqueId = value; } } - + /// /// Returns true if user needs reauthentication /// @@ -77,7 +78,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl get; set; } - + /// /// User display info /// diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountDisplayInfo.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountDisplayInfo.cs index ac4d40e2..9ca1b141 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountDisplayInfo.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountDisplayInfo.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ResourceProvider.Core.Authentication; @@ -45,8 +46,8 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl /// public bool Equals(IAzureUserAccountDisplayInfo other) { - return other != null && - ((other.AccountDisplayName == null && AccountDisplayName == null ) || (other.AccountDisplayName != null && other.AccountDisplayName.Equals(AccountDisplayName))) && + return other != null && + ((other.AccountDisplayName == null && AccountDisplayName == null ) || (other.AccountDisplayName != null && other.AccountDisplayName.Equals(AccountDisplayName))) && ((other.UserName == null && UserName == null ) || (other.UserName != null && other.UserName.Equals(UserName))); } diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountSubscriptionContext.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountSubscriptionContext.cs index 6c03c946..fed03df5 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountSubscriptionContext.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureUserAccountSubscriptionContext.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.Rest; @@ -28,7 +29,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl } /// - /// Creates a subscription context for connecting with a known access token. This creates a object for use + /// Creates a subscription context for connecting with a known access token. This creates a object for use /// in a request /// public static AzureUserAccountSubscriptionContext CreateStringTokenContext(AzureSubscriptionIdentifier subscription, string accessToken) @@ -62,7 +63,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl } /// - /// + /// /// public bool Equals(IAzureUserAccountSubscriptionContext other) { diff --git a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/SqlAzureResource.cs b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/SqlAzureResource.cs index 47929de1..18829bae 100644 --- a/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/SqlAzureResource.cs +++ b/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/SqlAzureResource.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.SqlTools.ResourceProvider.Core; @@ -17,7 +18,7 @@ namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl private readonly Models.Server _azureSqlServerResource; /// - /// Initializes the resource + /// Initializes the resource /// public SqlAzureResource(Models.Server azureResource) : base(azureResource) { diff --git a/src/Microsoft.SqlTools.ResourceProvider/Program.cs b/src/Microsoft.SqlTools.ResourceProvider/Program.cs index 7d71f6aa..9534cc20 100644 --- a/src/Microsoft.SqlTools.ResourceProvider/Program.cs +++ b/src/Microsoft.SqlTools.ResourceProvider/Program.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Diagnostics; diff --git a/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs b/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs index 6fbf8bbd..5f3b62a5 100644 --- a/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs +++ b/src/Microsoft.SqlTools.ResourceProvider/ResourceProviderHostLoader.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Collections.Generic; using System.Reflection; diff --git a/src/Microsoft.SqlTools.ServiceLayer/AzureFunctions/AzureFunctionsUtils.cs b/src/Microsoft.SqlTools.ServiceLayer/AzureFunctions/AzureFunctionsUtils.cs index 6d4fdc02..55036467 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/AzureFunctions/AzureFunctionsUtils.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/AzureFunctions/AzureFunctionsUtils.cs @@ -1,4 +1,9 @@ -using Microsoft.CodeAnalysis.CSharp.Syntax; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.CodeAnalysis.CSharp.Syntax; using System; using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/CancelTokenKey.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/CancelTokenKey.cs index 9976916b..c73becbf 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/CancelTokenKey.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/CancelTokenKey.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs index 1be5e7db..2768c1f8 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs @@ -11,7 +11,6 @@ using System.Data.Common; using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider; using System.Globalization; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.SqlTools.Hosting.Protocol; diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs index 7798f95a..bbcefd1c 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/SecurityTokenRequest.cs @@ -1,4 +1,9 @@ -using Microsoft.SqlTools.Hosting.Protocol.Contracts; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.SqlTools.Hosting.Protocol.Contracts; namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts { diff --git a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs index 7db67b6c..aac32e0f 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs @@ -1,6 +1,7 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections; diff --git a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryConstants.cs b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryConstants.cs index 4290a15f..195c38d2 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryConstants.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryConstants.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Microsoft.SqlTools.ServiceLayer/EditData/Contracts/EditCellResult.cs b/src/Microsoft.SqlTools.ServiceLayer/EditData/Contracts/EditCellResult.cs index 2faff227..bf4383fd 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/EditData/Contracts/EditCellResult.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/EditData/Contracts/EditCellResult.cs @@ -1,4 +1,9 @@ -namespace Microsoft.SqlTools.ServiceLayer.EditData.Contracts +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +namespace Microsoft.SqlTools.ServiceLayer.EditData.Contracts { /// /// Parameters to return when a cell is updated in isolation diff --git a/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs b/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs index 0cf81912..084341dd 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading.Tasks; diff --git a/src/Microsoft.SqlTools.ServiceLayer/Management/Common/ExecutionHandler.cs b/src/Microsoft.SqlTools.ServiceLayer/Management/Common/ExecutionHandler.cs index 57e49729..33e20005 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Management/Common/ExecutionHandler.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Management/Common/ExecutionHandler.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections; using System.Text; diff --git a/src/Microsoft.SqlTools.ServiceLayer/NotebookConvert/Notebook.cs b/src/Microsoft.SqlTools.ServiceLayer/NotebookConvert/Notebook.cs index d339249b..a8662ee2 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/NotebookConvert/Notebook.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/NotebookConvert/Notebook.cs @@ -1,4 +1,9 @@ -using Newtonsoft.Json; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Newtonsoft.Json; using System; using System.Collections.Generic; diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNodeWithContext.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNodeWithContext.cs index 0ff80faa..80c8b5e1 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNodeWithContext.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/TreeNodeWithContext.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs index a0ddb7ea..04546edf 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs @@ -1,4 +1,9 @@ -// This file was generated by a T4 Template. Do not modify directly, instead update the SmoQueryModelDefinition.xml file +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +// 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". diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.tt b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.tt index c9ecd553..1bfa0f0f 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.tt +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.tt @@ -7,6 +7,11 @@ <#@ import namespace="System.Xml" #> <#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.IO" #> +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + // 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". @@ -24,7 +29,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel <# var directory = Path.GetDirectoryName(Host.TemplateFile); string xmlFile = Path.Combine(directory, "SmoQueryModelDefinition.xml"); - + ///////// // Now generate all the Query methods ///////// @@ -71,19 +76,19 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(string.Format("if ({0} != null)", parentVar)); WriteLine("{"); PushIndent(indent); - + XmlElement navPathElement = GetNavPathElement(xmlFile, nodeName, parentType); string navigationPath = GetNavigationPath(nodeElement, nodeName, navPathElement); string subField = GetNavPathAttribute(navPathElement, "SubField"); string fieldType = GetNavPathAttribute(navPathElement, "FieldType"); - + WriteLine(string.Format("var retValue = {0}.{1};", parentVar, navigationPath)); WriteLine("if (retValue != null)"); WriteLine("{"); PushIndent(indent); - - + + if (IsCollection(nodeElement)) { WriteLine(string.Format("retValue.ClearAndInitialize(filter, extraProperties);")); @@ -91,7 +96,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { WriteLine(string.Format("return new SmoCollectionWrapper<{0}>(retValue).Where(c => PassesFinalFilters({1}, c));", nodeType, parentVar)); } - else + else { WriteLine(string.Format("List<{0}> subFieldResult = new List<{0}>();", nodeType)); WriteLine(string.Format("foreach({0} field in retValue)", fieldType)); @@ -119,7 +124,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine("}"); WriteLine("return new SqlSmoObject[] { retValue };"); } - + PopIndent(); WriteLine("}"); PopIndent(); @@ -158,7 +163,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel } return typesList.ToArray(); } - + public static XmlElement GetNodeElement(string xmlFile, string nodeName) { XmlDocument doc = new XmlDocument(); @@ -171,7 +176,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel XmlDocument doc = new XmlDocument(); doc.Load(xmlFile); XmlElement navPathElement = (XmlElement)doc.SelectSingleNode(string.Format("/SmoQueryModel/Node[@Name='{0}']/NavigationPath[@Parent='{1}']", nodeName, parent)); - + return navPathElement; } @@ -193,7 +198,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel string nodeTypeAccessor = IsCollection(nodeElement) ? string.Format("{0}s", nodeType) : nodeType; return nodeTypeAccessor; } - + public static string GetNodeType(XmlElement nodeElement, string nodeName) { var type = nodeElement.GetAttribute("Type"); @@ -205,7 +210,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel var prefix = "Sql"; return nodeName.IndexOf(prefix) == 0 ? nodeName.Substring(prefix.Length) : nodeName; } - + public static bool IsCollection(XmlElement nodeElement) { var collection = nodeElement.GetAttribute("Collection"); @@ -225,7 +230,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { return new string[] { parentAttr }; } - + var parentNodes = GetChildren(xmlFile, parentName, "Parent"); if (parentNodes != null && parentNodes.Count > 0) { @@ -236,7 +241,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel } return parents; } - + // default to assuming a type is under Database return new string[] { "Database" }; } diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs index 1d13751d..64fc02f3 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.cs @@ -1,13 +1,17 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Composition; using Microsoft.SqlServer.Management.Smo; -using Microsoft.SqlTools.ServiceLayer; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { - + internal sealed partial class DatabaseTreeNode : SmoTreeNode { public DatabaseTreeNode() : base() diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.tt b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.tt index 0e1f9ce5..b5e94c53 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.tt +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/TreeNodeGenerator.tt @@ -7,20 +7,24 @@ <#@ import namespace="System.Xml" #> <#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.IO" #> +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Composition; using Microsoft.SqlServer.Management.Smo; -using Microsoft.SqlTools.ServiceLayer; using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes; namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { - + <# var directory = Path.GetDirectoryName(Host.TemplateFile); string xmlFile = Path.Combine(directory, "TreeNodeDefinition.xml"); - + ///////// // TODO - is Generate all the ReverseDependencies needed? ///////// @@ -43,11 +47,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel // { // dependentListBuilder.Append(","); // } - // + // // dependentListBuilder.Append(string.Format(CultureInfo.InvariantCulture, " typeof({0})", dependentType)); // } // dependentListBuilder.Append(" }"); - // + // // WriteLine(string.Format(CultureInfo.InvariantCulture, " {{ typeof({0}), new List {1} }}", reverseDependencyKey, dependentListBuilder.ToString())); // } // WriteLine(" };"); @@ -92,19 +96,19 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel var disableSort = nodeElement.GetAttributeNode("DisableSort"); string childFactoryBaseClass = "SmoChildFactoryBase"; - + // TODO Will we need alternative child factories? If so, add code here to support this - + if (isAlwaysLeaf == null) { WriteLine(" [Export(typeof(ChildFactory))]"); WriteLine(" [Shared]"); - + WriteLine(string.Format(" internal partial class {0}ChildFactory : {1}", type, childFactoryBaseClass)); - + WriteLine(" {"); WriteLine(string.Format(" public override IEnumerable ApplicableParents() {{ return new[] {{ \"{0}\" }}; }}", type)); - + List children = GetChildren(xmlFile, type); List filters = GetNodeFilters(xmlFile, type); List smoProperties = GetNodeSmoProperties(xmlFile, type); @@ -118,7 +122,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(" {"); WriteLine(" var filters = new List();"); - foreach (var filter in filters) + foreach (var filter in filters) { var propertyName = filter.GetAttribute("Property"); var propertyType = filter.GetAttribute("Type"); @@ -128,7 +132,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel List filterValues = GetNodeFilterValues(xmlFile, type, propertyName); - + WriteLine(" filters.Add(new NodeFilter"); WriteLine(" {"); WriteLine(string.Format(" Property = \"{0}\",", propertyName)); @@ -141,20 +145,20 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel { WriteLine(string.Format(" ValidFor = {0},", GetValidForFlags(validFor))); } - if (propertyValue != null && (filterValues == null || filterValues.Count == 0)) + if (propertyValue != null && (filterValues == null || filterValues.Count == 0)) { WriteLine(string.Format(" Values = new List {{ {0} }},", propertyValue)); } - if (filterValues != null && filterValues.Count > 0) + if (filterValues != null && filterValues.Count > 0) { string filterValueType = "object"; - if (propertyType == "Enum") + if (propertyType == "Enum") { - + } WriteLine(string.Format(" Values = new List")); WriteLine(string.Format(" {{")); - for(int i = 0; i < filterValues.Count; i++) + for(int i = 0; i < filterValues.Count; i++) { string separator = ""; if (i != filterValues.Count - 1) @@ -163,19 +167,19 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel } var filterValue = filterValues[i]; WriteLine(string.Format(" {{ {0} }}{1}", filterValue.InnerText, separator )); - + } WriteLine(string.Format(" }}")); } WriteLine(" });"); - + } - + WriteLine(" return filters;"); WriteLine(" }"); WriteLine(" }"); - + } @@ -188,34 +192,34 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(" {"); WriteLine(" var properties = new List();"); - foreach (var smoPropertiy in smoProperties) + foreach (var smoPropertiy in smoProperties) { var propertyName = smoPropertiy.GetAttribute("Name"); var validFor = smoPropertiy.GetAttribute("ValidFor"); - - + + WriteLine(" properties.Add(new NodeSmoProperty"); WriteLine(" {"); WriteLine(string.Format(" Name = \"{0}\",", propertyName)); - + if (!string.IsNullOrWhiteSpace(validFor)) { WriteLine(string.Format(" ValidFor = {0}", GetValidForFlags(validFor))); } WriteLine(" });"); - - + + } - + WriteLine(" return properties;"); WriteLine(" }"); WriteLine(" }"); - + } - + if (children.Count > 0) { WriteLine(""); @@ -244,7 +248,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(string.Format(" NodeType = \"{0}\",", "Folder")); WriteLine(string.Format(" NodeTypeId = NodeTypes.{0},", child.GetAttribute("Name"))); WriteLine(string.Format(" IsSystemObject = {0},", child.GetAttribute("IsSystemObject") == "1" ? "true" : "false")); - + if (msShippedOwned != null) { WriteLine(" IsMsShippedOwned = true,"); @@ -285,20 +289,20 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(" }"); WriteLine(""); - + WriteLine(" public override TreeNode CreateChild(TreeNode parent, object context)"); WriteLine(" {"); if (string.IsNullOrWhiteSpace(TreeNode)) { WriteLine(" var child = new SmoTreeNode();"); WriteLine(" child.IsAlwaysLeaf = true;"); - - if (!string.IsNullOrEmpty(nodeType)) + + if (!string.IsNullOrEmpty(nodeType)) { - + WriteLine(string.Format(" child.NodeType = \"{0}\";", nodeType)); } - + } else { @@ -314,7 +318,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(" child.SortPriority = SmoTreeNode.NextSortPriority;"); } WriteLine(" InitializeChild(parent, child, context);"); - + WriteLine(" return child;"); WriteLine(" }"); @@ -332,7 +336,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel WriteLine(" return null;"); WriteLine(" }"); } - + WriteLine(" }"); WriteLine(""); } @@ -425,7 +429,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel } return typesList.ToArray(); } - + public static Dictionary> GetReverseDependencies(string xmlFile) { Dictionary> dependencyMap = new Dictionary>(); @@ -530,7 +534,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel } return retElements; } - + public static List GetNodeSmoProperties(string xmlFile, string parentName) { diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs index 5b12500e..75d91a6b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/ValidForFlag.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Microsoft.SqlTools.ServiceLayer/Program.cs b/src/Microsoft.SqlTools.ServiceLayer/Program.cs index bfe69856..4b481e1a 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Program.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Program.cs @@ -1,6 +1,8 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using Microsoft.SqlTools.ServiceLayer.Hosting; using Microsoft.SqlTools.ServiceLayer.SqlContext; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs index efee6697..43bbab74 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Batch.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs index e5200034..8bdb2498 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/DbColumnWrapper.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs index 6021e6df..ab8ea3f1 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/BatchEvents.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.Hosting.Protocol.Contracts; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs index 23c40a67..5e563ed2 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ExecuteRequestResult.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts.ExecuteRequests { diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs index 9dc74525..d0909999 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecuteRequests/ResultSetEvents.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Collections.Generic; using Microsoft.SqlTools.Hosting.Protocol.Contracts; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs index 4054eecc..ade4380b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/ExecutionPlanOptions.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts { diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/SelectionData.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/SelectionData.cs index 183f2b3c..249679b0 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/SelectionData.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/Contracts/SelectionData.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultOnlyContext.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultOnlyContext.cs index 5b1fad16..6454ed72 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultOnlyContext.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultOnlyContext.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.Hosting.Protocol; using System.Threading.Tasks; diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultSet.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultSet.cs index f2a50e09..867e6fa8 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultSet.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/ResultSet.cs @@ -1,5 +1,4 @@ -// -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // diff --git a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/SpecialAction.cs b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/SpecialAction.cs index 4598b018..fa389cef 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/SpecialAction.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/QueryExecution/SpecialAction.cs @@ -1,6 +1,8 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; namespace Microsoft.SqlTools.ServiceLayer.QueryExecution diff --git a/src/Microsoft.SqlTools.ServiceLayer/Utility/AccessTokenProvider.cs b/src/Microsoft.SqlTools.ServiceLayer/Utility/AccessTokenProvider.cs index 99063d29..500d5fd3 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Utility/AccessTokenProvider.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Utility/AccessTokenProvider.cs @@ -1,4 +1,9 @@ -using Microsoft.SqlServer.Dac; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.SqlServer.Dac; using System; namespace Microsoft.SqlTools.ServiceLayer.Utility diff --git a/src/Microsoft.SqlTools.ServiceLayer/Utility/ServiceLayerCommandOptions.cs b/src/Microsoft.SqlTools.ServiceLayer/Utility/ServiceLayerCommandOptions.cs index 18728b47..25d0a76d 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Utility/ServiceLayerCommandOptions.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Utility/ServiceLayerCommandOptions.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Globalization; diff --git a/test/Microsoft.InsightsGenerator.UnitTests/SignatureGeneratorTests.cs b/test/Microsoft.InsightsGenerator.UnitTests/SignatureGeneratorTests.cs index f4854f14..65509b48 100644 --- a/test/Microsoft.InsightsGenerator.UnitTests/SignatureGeneratorTests.cs +++ b/test/Microsoft.InsightsGenerator.UnitTests/SignatureGeneratorTests.cs @@ -1,6 +1,10 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; -using System.Text; using Xunit; diff --git a/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs b/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs index 97fdc601..2697e4eb 100644 --- a/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs +++ b/test/Microsoft.InsightsGenerator.UnitTests/WorkflowTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Text; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Admin/AdminServiceTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Admin/AdminServiceTests.cs index 82382015..455f3a7c 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Admin/AdminServiceTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Admin/AdminServiceTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Linq; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionInfoTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionInfoTests.cs index 395f1970..f55252f3 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionInfoTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionInfoTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using Microsoft.Kusto.ServiceLayer.Connection; using Microsoft.Kusto.ServiceLayer.Connection.Contracts; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionProviderOptionsHelperTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionProviderOptionsHelperTests.cs index fa6f7f2b..d3219753 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionProviderOptionsHelperTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/ConnectionProviderOptionsHelperTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.Connection; using NUnit.Framework; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/DataSourceConnectionFactoryTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/DataSourceConnectionFactoryTests.cs index c1af8f54..961c14d8 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/DataSourceConnectionFactoryTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Connection/DataSourceConnectionFactoryTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.Connection; using Microsoft.Kusto.ServiceLayer.Connection.Contracts; using Microsoft.Kusto.ServiceLayer.DataSource; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceFactoryTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceFactoryTests.cs index 24cae278..e7714c90 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceFactoryTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceFactoryTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using Microsoft.Kusto.ServiceLayer.Connection.Contracts; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseClientTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseClientTests.cs index 8c2ba4be..5a594104 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseClientTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseClientTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Collections.Generic; using System.Linq; using System.Threading; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseHelperTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseHelperTests.cs index 7c0c87ea..5746f134 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseHelperTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/DataSourceIntellisense/KustoIntellisenseHelperTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.DataSource.Intellisense; using Microsoft.Kusto.ServiceLayer.DataSource.Kusto; using Microsoft.Kusto.ServiceLayer.LanguageServices; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoClientTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoClientTests.cs index 10e3a189..31b0e384 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoClientTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoClientTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using Microsoft.Kusto.ServiceLayer.DataSource.Contracts; using Microsoft.Kusto.ServiceLayer.DataSource.Kusto; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoQueryUtilsTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoQueryUtilsTests.cs index 710dd29f..b34c3190 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoQueryUtilsTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/KustoQueryUtilsTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/Metadata/MetadataFactoryTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/Metadata/MetadataFactoryTests.cs index fad1f75a..3a9d187e 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/Metadata/MetadataFactoryTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/DataSource/Metadata/MetadataFactoryTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Linq; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/AutoCompleteHelperTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/AutoCompleteHelperTests.cs index f19d3e29..cc9e20df 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/AutoCompleteHelperTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/AutoCompleteHelperTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Linq; using Microsoft.Kusto.ServiceLayer.LanguageServices; using Microsoft.Kusto.ServiceLayer.LanguageServices.Contracts; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/BindingQueueTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/BindingQueueTests.cs index 1095d147..b7b53692 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/BindingQueueTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/BindingQueueTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Threading; using Microsoft.Kusto.ServiceLayer.LanguageServices; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/ConnectedBindingQueueTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/ConnectedBindingQueueTests.cs index 3f4b59c3..5bd7da67 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/ConnectedBindingQueueTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/ConnectedBindingQueueTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using Microsoft.Kusto.ServiceLayer.Connection; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/DiagnosticsHelperTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/DiagnosticsHelperTests.cs index 4acd7e11..1254a6a3 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/DiagnosticsHelperTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/LanguageServices/DiagnosticsHelperTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Linq; using System.Threading.Tasks; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Metadata/MetadataServiceTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Metadata/MetadataServiceTests.cs index 1c8ac24d..6e7cabfd 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Metadata/MetadataServiceTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Metadata/MetadataServiceTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/ObjectExplorer/DataSourceModel/ServerNodeTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/ObjectExplorer/DataSourceModel/ServerNodeTests.cs index f70f97ae..de9683ed 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/ObjectExplorer/DataSourceModel/ServerNodeTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/ObjectExplorer/DataSourceModel/ServerNodeTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Collections.Generic; using System.Linq; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Scripting/ScripterTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Scripting/ScripterTests.cs index e83e42eb..fd1ad898 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Scripting/ScripterTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Scripting/ScripterTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using Microsoft.Kusto.ServiceLayer.DataSource; using Microsoft.Kusto.ServiceLayer.Scripting; using Microsoft.Kusto.ServiceLayer.Scripting.Contracts; diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/ServiceHost/SrTests.cs b/test/Microsoft.Kusto.ServiceLayer.UnitTests/ServiceHost/SrTests.cs index 4c73b408..1c0eb976 100644 --- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/ServiceHost/SrTests.cs +++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/ServiceHost/SrTests.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.Kusto.ServiceLayer.Utility; using NUnit.Framework; diff --git a/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/FileUtilities.cs b/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/FileUtilities.cs index f99b25bf..509e14b1 100644 --- a/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/FileUtilities.cs +++ b/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/FileUtilities.cs @@ -1,4 +1,9 @@ -using System.IO; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.IO; namespace Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.Utility { diff --git a/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/LiveConnectionHelper.cs b/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/LiveConnectionHelper.cs index 574ffbb7..b8792bd5 100644 --- a/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/LiveConnectionHelper.cs +++ b/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Utility/LiveConnectionHelper.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using Microsoft.Data.SqlClient; using System.IO; using System.Reflection; diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Agent/AgentNotebookTests.cs b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Agent/AgentNotebookTests.cs index 88257a5d..634640b3 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Agent/AgentNotebookTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Agent/AgentNotebookTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; using System.Threading.Tasks; using Microsoft.SqlTools.Hosting.Protocol; diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/AzureFunctions/AzureFunctionsServiceTests.cs b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/AzureFunctions/AzureFunctionsServiceTests.cs index 0ed86460..fa9fc730 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/AzureFunctions/AzureFunctionsServiceTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/AzureFunctions/AzureFunctionsServiceTests.cs @@ -1,4 +1,9 @@ -using Microsoft.SqlTools.Hosting.Protocol; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.SqlTools.Hosting.Protocol; using Microsoft.SqlTools.ServiceLayer.AzureFunctions; using Microsoft.SqlTools.ServiceLayer.AzureFunctions.Contracts; using Microsoft.SqlTools.ServiceLayer.Utility; diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/TaskServices/RequstParamStub.cs b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/TaskServices/RequstParamStub.cs index 48010758..afd37167 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/TaskServices/RequstParamStub.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/TaskServices/RequstParamStub.cs @@ -1,4 +1,9 @@ -using Microsoft.SqlTools.ServiceLayer.TaskServices; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.SqlTools.ServiceLayer.TaskServices; using Microsoft.SqlTools.ServiceLayer.Utility; namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.TaskServices diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Utility/LiveConnectionHelper.cs b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Utility/LiveConnectionHelper.cs index bf957687..1ab197e4 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Utility/LiveConnectionHelper.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Utility/LiveConnectionHelper.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using Microsoft.Data.SqlClient; using System.Globalization; using System.IO; diff --git a/test/Microsoft.SqlTools.ServiceLayer.PerfTests/Properties/AssemblyInfo.cs b/test/Microsoft.SqlTools.ServiceLayer.PerfTests/Properties/AssemblyInfo.cs index 825d07ad..fc716e0b 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.PerfTests/Properties/AssemblyInfo.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.PerfTests/Properties/AssemblyInfo.cs @@ -1,4 +1,9 @@ -using System.Reflection; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/Extensions/ExceptionExtensions.cs b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/Extensions/ExceptionExtensions.cs index 8f583ef2..7c16fbd3 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/Extensions/ExceptionExtensions.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/Extensions/ExceptionExtensions.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Text; namespace Microsoft.SqlTools.ServiceLayer.Test.Common.Extensions diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/MemoryFileSystem.cs b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/MemoryFileSystem.cs index 090f5fcb..f3892127 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/MemoryFileSystem.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/MemoryFileSystem.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Concurrent; using System.IO; using Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage; diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestEventContext.cs b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestEventContext.cs index 1fd970b7..7bcbf86c 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestEventContext.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test.Common/TestEventContext.cs @@ -1,4 +1,9 @@ -using System.Threading.Tasks; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.Threading.Tasks; using Microsoft.SqlTools.Hosting.Protocol; using Microsoft.SqlTools.Hosting.Protocol.Contracts; diff --git a/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Properties/AssemblyInfo.cs b/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Properties/AssemblyInfo.cs index 837d50fc..6ef9f3ba 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Properties/AssemblyInfo.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Properties/AssemblyInfo.cs @@ -1,4 +1,9 @@ -using System.Reflection; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Properties/AssemblyInfo.cs b/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Properties/AssemblyInfo.cs index 4efbd126..30515a2f 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Properties/AssemblyInfo.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.TestEnvConfig/Properties/AssemblyInfo.cs @@ -1,4 +1,9 @@ -using System.Reflection; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/SrTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/SrTests.cs index 35cb2216..42a0d0ba 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/SrTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/SrTests.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.Hosting.Utility; using NUnit.Framework; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/CredentialSetTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/CredentialSetTests.cs index dd1a6c3c..84819b29 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/CredentialSetTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/CredentialSetTests.cs @@ -1,6 +1,6 @@ // -// Code originally from http://credentialmanagement.codeplex.com/, -// Licensed under the Apache License 2.0 +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/Win32CredentialTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/Win32CredentialTests.cs index 5a66b847..5e60e50a 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/Win32CredentialTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Credentials/Win32/Win32CredentialTests.cs @@ -1,6 +1,6 @@ // -// Code originally from http://credentialmanagement.codeplex.com/, -// Licensed under the Apache License 2.0 +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/LanguageExtensibility/ExternalLanguageOperationTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/LanguageExtensibility/ExternalLanguageOperationTests.cs index a1fb7068..9a354cf7 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/LanguageExtensibility/ExternalLanguageOperationTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/LanguageExtensibility/ExternalLanguageOperationTests.cs @@ -1,4 +1,9 @@ -using Microsoft.SqlTools.ServiceLayer.LanguageExtensibility; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using Microsoft.SqlTools.ServiceLayer.LanguageExtensibility; using Microsoft.SqlTools.ServiceLayer.LanguageExtensibility.Contracts; using Microsoft.SqlTools.ServiceLayer.Test.Common; using Moq; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureDatabaseDiscoveryProviderTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureDatabaseDiscoveryProviderTest.cs index 2317a90b..78db4493 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureDatabaseDiscoveryProviderTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureDatabaseDiscoveryProviderTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSqlServerDiscoveryProviderTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSqlServerDiscoveryProviderTest.cs index f7cf7bf2..e3827a19 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSqlServerDiscoveryProviderTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSqlServerDiscoveryProviderTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSubscriptionContextTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSubscriptionContextTest.cs index e2214642..9c1d9ebb 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSubscriptionContextTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureSubscriptionContextTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.SqlTools.ResourceProvider.DefaultImpl; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureTestContext.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureTestContext.cs index cf4164ff..da446dc0 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureTestContext.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/AzureTestContext.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/FakeAzureServerDiscoveryProvider.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/FakeAzureServerDiscoveryProvider.cs index fce524e0..1a62b0f8 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/FakeAzureServerDiscoveryProvider.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Azure/FakeAzureServerDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading.Tasks; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/DependencyManagerTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/DependencyManagerTest.cs index 51dc62c0..782deee3 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/DependencyManagerTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/DependencyManagerTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// // TODO Ideally would reenable these but using ExtensionServiceProvider diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ExceptionUtilTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ExceptionUtilTest.cs index f5ca1f56..0ffde083 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ExceptionUtilTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ExceptionUtilTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Data.Common; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager.cs index 702033c9..1240a18b 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading.Tasks; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager2.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager2.cs index e652f984..4e754b31 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager2.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeAccountManager2.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading.Tasks; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDataFactory.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDataFactory.cs index ceba7352..cfa5fd3f 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDataFactory.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDataFactory.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseDiscoveryProvider.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseDiscoveryProvider.cs index f587173e..e6ad7e32 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseDiscoveryProvider.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Threading; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseResourceManager.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseResourceManager.cs index d4754205..3bdf3f33 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseResourceManager.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeDatabaseResourceManager.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ResourceProvider.Core.Extensibility; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeSecureServerDiscoveryProvider.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeSecureServerDiscoveryProvider.cs index c8a8043c..2c2cf7ac 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeSecureServerDiscoveryProvider.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeSecureServerDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Threading.Tasks; using Microsoft.SqlTools.ResourceProvider.Core; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider.cs index abc6fd5c..2bef5797 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Threading.Tasks; using Microsoft.SqlTools.ResourceProvider.Core; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider2.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider2.cs index a5d9a0e3..c2c8bae6 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider2.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeServerDiscoveryProvider2.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Threading.Tasks; using Microsoft.SqlTools.ResourceProvider.Core; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeTrace.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeTrace.cs index 6ee09707..993c9270 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeTrace.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/Fakes/FakeTrace.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallErrorParserTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallErrorParserTest.cs index 23491ccf..9e8c4e88 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallErrorParserTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallErrorParserTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using Microsoft.SqlTools.ResourceProvider.Core.Firewall; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallRuleServiceTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallRuleServiceTest.cs index c0aa844c..284eaa05 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallRuleServiceTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/FirewallRuleServiceTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ServiceManagerTest.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ServiceManagerTest.cs index 3ea38275..fdf8b19d 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ServiceManagerTest.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ResourceProvider/ServiceManagerTest.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Collections.Generic; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Scripting/ScriptingExtensionMethodsTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Scripting/ScriptingExtensionMethodsTests.cs index 1a7ff2b0..6fdb3e2f 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Scripting/ScriptingExtensionMethodsTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Scripting/ScriptingExtensionMethodsTests.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Text; using Microsoft.SqlServer.Management.Sdk.Sfc; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/LoggerTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/LoggerTests.cs index 870bb397..49eda21c 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/LoggerTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/LoggerTests.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System.Diagnostics; using System.IO; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/ScriptFileTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/ScriptFileTests.cs index a5d5c194..b70e762b 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/ScriptFileTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/ScriptFileTests.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Linq; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs index f895111f..236c193b 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs @@ -1,6 +1,7 @@ // // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using Microsoft.SqlTools.ServiceLayer.Utility; using NUnit.Framework; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ShowPlan/ShowPlanTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ShowPlan/ShowPlanTests.cs index 95656b89..39c9f18b 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ShowPlan/ShowPlanTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ShowPlan/ShowPlanTests.cs @@ -1,3 +1,8 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + using System; // // Copyright (c) Microsoft. All rights reserved. diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestDbColumn.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestDbColumn.cs index 17fde31c..ed5cd56f 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestDbColumn.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestDbColumn.cs @@ -1,6 +1,7 @@ -// +// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// using System; using System.Data.Common; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestUtils.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestUtils.cs index c7ed4ac4..bef6bbe1 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestUtils.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/TestUtils.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Threading; using System.Threading.Tasks; using Microsoft.SqlTools.Hosting.Protocol; diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/UtilityTests/ToSqlScriptTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/UtilityTests/ToSqlScriptTests.cs index cca5da6d..1135340e 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/UtilityTests/ToSqlScriptTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/UtilityTests/ToSqlScriptTests.cs @@ -1,4 +1,9 @@ -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; using System.Collections.Generic; using System.Data.Common; using System.Text.RegularExpressions; diff --git a/test/ScriptGenerator/Program.cs b/test/ScriptGenerator/Program.cs index 8e2f0481..377707c1 100644 --- a/test/ScriptGenerator/Program.cs +++ b/test/ScriptGenerator/Program.cs @@ -1,5 +1,9 @@ -using ScriptGenerator.Properties; -using System; +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using ScriptGenerator.Properties; using System.IO; using System.Text.RegularExpressions;