diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..3b3dd080 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,368 @@ +root = true + +# All files +[*] +indent_style = space + +# Xml files +[*.xml] +indent_size = 2 + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Coding Conventions #### +[*.{cs,vb}] + +# Organize usings +dotnet_separate_import_directive_groups = true +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:silent +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_property = false:silent + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent + +# Expression-level preferences +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_object_initializer = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_return = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion + +# Field preferences +dotnet_style_readonly_field = true:warning + +# Parameter preferences +dotnet_code_quality_unused_parameters = all:suggestion + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +#### C# Coding Conventions #### +[*.cs] + +# var preferences +csharp_style_var_elsewhere = false:silent +csharp_style_var_for_built_in_types = false:silent +csharp_style_var_when_type_is_apparent = false:silent + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_lambdas = true:suggestion +csharp_style_expression_bodied_local_functions = false:silent +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion +csharp_style_prefer_pattern_matching = true:silent +csharp_style_prefer_switch_expression = true:suggestion + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:suggestion + +# Modifier preferences +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_braces = true:silent +csharp_prefer_simple_using_statement = true:suggestion + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +#### 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 #### +[*.{cs,vb}] + +# Naming rules + +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces +dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion +dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces +dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase + +dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion +dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters +dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase + +dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods +dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties +dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.events_should_be_pascalcase.symbols = events +dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables +dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase + +dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion +dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants +dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase + +dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion +dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters +dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase + +dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields +dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion +dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields +dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase + +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase + +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields +dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields +dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields +dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields +dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums +dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase + +dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase + +# Symbol specifications + +dotnet_naming_symbols.interfaces.applicable_kinds = interface +dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interfaces.required_modifiers = + +dotnet_naming_symbols.enums.applicable_kinds = enum +dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.enums.required_modifiers = + +dotnet_naming_symbols.events.applicable_kinds = event +dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.events.required_modifiers = + +dotnet_naming_symbols.methods.applicable_kinds = method +dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.methods.required_modifiers = + +dotnet_naming_symbols.properties.applicable_kinds = property +dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.properties.required_modifiers = + +dotnet_naming_symbols.public_fields.applicable_kinds = field +dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_fields.required_modifiers = + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_fields.required_modifiers = + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_fields.required_modifiers = static + +dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum +dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types_and_namespaces.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 = + +dotnet_naming_symbols.type_parameters.applicable_kinds = namespace +dotnet_naming_symbols.type_parameters.applicable_accessibilities = * +dotnet_naming_symbols.type_parameters.required_modifiers = + +dotnet_naming_symbols.private_constant_fields.applicable_kinds = field +dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_constant_fields.required_modifiers = const + +dotnet_naming_symbols.local_variables.applicable_kinds = local +dotnet_naming_symbols.local_variables.applicable_accessibilities = local +dotnet_naming_symbols.local_variables.required_modifiers = + +dotnet_naming_symbols.local_constants.applicable_kinds = local +dotnet_naming_symbols.local_constants.applicable_accessibilities = local +dotnet_naming_symbols.local_constants.required_modifiers = const + +dotnet_naming_symbols.parameters.applicable_kinds = parameter +dotnet_naming_symbols.parameters.applicable_accessibilities = * +dotnet_naming_symbols.parameters.required_modifiers = + +dotnet_naming_symbols.public_constant_fields.applicable_kinds = field +dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_constant_fields.required_modifiers = const + +dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal +dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static + +dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected +dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function +dotnet_naming_symbols.local_functions.applicable_accessibilities = * +dotnet_naming_symbols.local_functions.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascalcase.required_prefix = +dotnet_naming_style.pascalcase.required_suffix = +dotnet_naming_style.pascalcase.word_separator = +dotnet_naming_style.pascalcase.capitalization = pascal_case + +dotnet_naming_style.ipascalcase.required_prefix = I +dotnet_naming_style.ipascalcase.required_suffix = +dotnet_naming_style.ipascalcase.word_separator = +dotnet_naming_style.ipascalcase.capitalization = pascal_case + +dotnet_naming_style.tpascalcase.required_prefix = T +dotnet_naming_style.tpascalcase.required_suffix = +dotnet_naming_style.tpascalcase.word_separator = +dotnet_naming_style.tpascalcase.capitalization = pascal_case + +dotnet_naming_style._camelcase.required_prefix = _ +dotnet_naming_style._camelcase.required_suffix = +dotnet_naming_style._camelcase.word_separator = +dotnet_naming_style._camelcase.capitalization = camel_case + +dotnet_naming_style.camelcase.required_prefix = +dotnet_naming_style.camelcase.required_suffix = +dotnet_naming_style.camelcase.word_separator = +dotnet_naming_style.camelcase.capitalization = camel_case + +dotnet_naming_style.s_camelcase.required_prefix = s_ +dotnet_naming_style.s_camelcase.required_suffix = +dotnet_naming_style.s_camelcase.word_separator = +dotnet_naming_style.s_camelcase.capitalization = camel_case + +spelling_exclusion_path = .\exclusion.dic +spelling_checkable_types = strings,identifiers,comments +spelling_error_severity = error + diff --git a/exclusion.dic b/exclusion.dic new file mode 100644 index 00000000..05736362 --- /dev/null +++ b/exclusion.dic @@ -0,0 +1,64 @@ +valerie +ansi +specialname +awaitable +csproj +Usings +warnaserror +lpfl +cpuid +retq +vmax +decryptor +Abidal +Barthez +Coupet +Landreau +Boumsong +Chimbonda +Gallas +Givet +Sagnol +Thuram +Dhorasoo +Diarra +Makelele +Djibril Cisse +Saha +Trezeguet +Wiltord +Saha +Zaccardo +Zambrotta +Cannavaro +Oddo +Gattuso +Camoranesi +Gilardino +Iaquinta +beforefieldinit +mscorlib +Dever +Stokesbary +Heavey +enumtest +Equatable +Fireswamp +spokane +urls +iassist +Infos +IntelliTect +typelib +partnersintl +Wylam +attrs +deconstructor +Deconstructors +Hartfelt +Lindherst +Parksdale +Monteray +inigo +Machava +Uncompress \ No newline at end of file diff --git a/src/Chapter01/Listing01.21.CommentingYourCode.cs b/src/Chapter01/Listing01.21.CommentingYourCode.cs index a03aaade..510748e5 100644 --- a/src/Chapter01/Listing01.21.CommentingYourCode.cs +++ b/src/Chapter01/Listing01.21.CommentingYourCode.cs @@ -17,7 +17,7 @@ public static void Main() lastName = Console.ReadLine(); /* Display a greeting to the console - using composite fomatting. */ + using composite formatting. */ Console.WriteLine("Your full name is {1}, {0}.", firstName, lastName); diff --git a/src/Chapter03.Tests/Table03.03.Tests.cs b/src/Chapter03.Tests/Table03.03.Tests.cs index 1c923808..e180c402 100644 --- a/src/Chapter03.Tests/Table03.03.Tests.cs +++ b/src/Chapter03.Tests/Table03.03.Tests.cs @@ -25,7 +25,7 @@ public async Task ParseAndCompile(string fileNameSuffix, params string[] errorId [ExpectedException(typeof(IndexOutOfRangeException))] public void IndexingOffTheEndOfArrayTest() { - CommonArayCodingErrors.IndexingOffTheEndOfArray(); + CommonArrayCodingErrors.IndexingOffTheEndOfArray(); } // 7. @@ -33,7 +33,7 @@ public void IndexingOffTheEndOfArrayTest() [ExpectedException(typeof(IndexOutOfRangeException))] public void Hat0IsOnePastTheEndOfTheArray1Test() { - CommonArayCodingErrors.Hat0IsOnePastTheEndOfTheArray1(); + CommonArrayCodingErrors.Hat0IsOnePastTheEndOfTheArray1(); } // 8. @@ -41,6 +41,6 @@ public void Hat0IsOnePastTheEndOfTheArray1Test() [ExpectedException(typeof(IndexOutOfRangeException))] public void Hat0IsOnePastTheEndOfTheArray2Test() { - CommonArayCodingErrors.LastItemIsLengthMinus1(); + CommonArrayCodingErrors.LastItemIsLengthMinus1(); } } \ No newline at end of file diff --git a/src/Chapter03/Table03.01.TupleDeclarationAndAssignment.cs b/src/Chapter03/Table03.01.TupleDeclarationAndAssignment.cs index 0cb87b02..21611e4a 100644 --- a/src/Chapter03/Table03.01.TupleDeclarationAndAssignment.cs +++ b/src/Chapter03/Table03.01.TupleDeclarationAndAssignment.cs @@ -1,9 +1,9 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_01; -public class TupleDeclarationAndAssigment +public class TupleDeclarationAndAssignment { // 1. - public void AssignTupleToIndividuallyDeclaredVaraibles() + public void AssignTupleToIndividuallyDeclaredVariables() { (string country, string capital, double gdpPerCapita) = ("Burundi", "Bujumbura", 263.67); diff --git a/src/Chapter03/Table03.03.a.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.a.CommonArrayCodingErrors.cs index ef8b9ec5..ade797eb 100644 --- a/src/Chapter03/Table03.03.a.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.a.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 1. static public void SquareBracketsOnVariableRatherThanType() diff --git a/src/Chapter03/Table03.03.c.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.c.CommonArrayCodingErrors.cs index 88f5dcf6..4cac251a 100644 --- a/src/Chapter03/Table03.03.c.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.c.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 3. static public void ArraySizeCannotBeSpecifiedInDataType() diff --git a/src/Chapter03/Table03.03.d.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.d.CommonArrayCodingErrors.cs index 3e42e804..18af207c 100644 --- a/src/Chapter03/Table03.03.d.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.d.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 4. static public void ArraySizeOrInitializerIsRequired() diff --git a/src/Chapter03/Table03.03.e.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.e.CommonArrayCodingErrors.cs index 2cc9dfdf..a0231a6e 100644 --- a/src/Chapter03/Table03.03.e.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.e.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 5. static public void ArraySizeWithEmptyInitializer() diff --git a/src/Chapter03/Table03.03.f.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.f.CommonArrayCodingErrors.cs index 0cc8d38d..18caf793 100644 --- a/src/Chapter03/Table03.03.f.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.f.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 6. static public void IndexingOffTheEndOfArray() diff --git a/src/Chapter03/Table03.03.g.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.g.CommonArrayCodingErrors.cs index 02be04c1..6d7bbd05 100644 --- a/src/Chapter03/Table03.03.g.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.g.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 7. static public void Hat0IsOnePastTheEndOfTheArray1() diff --git a/src/Chapter03/Table03.03.h.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.h.CommonArrayCodingErrors.cs index ec701061..d3255c39 100644 --- a/src/Chapter03/Table03.03.h.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.h.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 8. static public void LastItemIsLengthMinus1() diff --git a/src/Chapter03/Table03.03.i.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.i.CommonArrayCodingErrors.cs index d4a3b75c..12cd0ee3 100644 --- a/src/Chapter03/Table03.03.i.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.i.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 9. static public void MultiDimensionalArrayWithInconsistentSize() diff --git a/src/Chapter03/Table03.03.j.CommonArrayCodingErrors.cs b/src/Chapter03/Table03.03.j.CommonArrayCodingErrors.cs index f6d9886b..84c7d3b8 100644 --- a/src/Chapter03/Table03.03.j.CommonArrayCodingErrors.cs +++ b/src/Chapter03/Table03.03.j.CommonArrayCodingErrors.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter03.Table03_03; -public partial class CommonArayCodingErrors +public partial class CommonArrayCodingErrors { // 10. static public void MembersInJaggedArraysMustBeInstantiated() diff --git a/src/Chapter06/Listing06.03.InstantiatingAClass.cs b/src/Chapter06/Listing06.03.InstantiatingAClass.cs index dfe92270..24d29077 100644 --- a/src/Chapter06/Listing06.03.InstantiatingAClass.cs +++ b/src/Chapter06/Listing06.03.InstantiatingAClass.cs @@ -1,4 +1,4 @@ -// Justificaiton: only partial implementation provided for elucidation. +// Justification: only partial implementation provided for elucidation. #pragma warning disable IDE0060 // Remove unused parameter namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_03; diff --git a/src/Chapter06/Listing06.15.UsingThePrivateAccessModifier.cs b/src/Chapter06/Listing06.15.UsingThePrivateAccessModifier.cs index 0f4aea7a..6c28482a 100644 --- a/src/Chapter06/Listing06.15.UsingThePrivateAccessModifier.cs +++ b/src/Chapter06/Listing06.15.UsingThePrivateAccessModifier.cs @@ -2,7 +2,7 @@ #pragma warning disable CS8618 // Our Main doesn't leverage everything in our Employee implementation - in production it would #pragma warning disable CS0649 -// Disabled pending introductin to object initializers +// Disabled pending introduction to object initializers #pragma warning disable IDE0017 // Add readonly modifier ignored pending introduction of the concept #pragma warning disable IDE0044 diff --git a/src/Chapter06/Listing06.17.DefiningProperties.cs b/src/Chapter06/Listing06.17.DefiningProperties.cs index 3f849140..106373de 100644 --- a/src/Chapter06/Listing06.17.DefiningProperties.cs +++ b/src/Chapter06/Listing06.17.DefiningProperties.cs @@ -1,6 +1,6 @@ // Non-nullable field is uninitialized. Consider declaring as nullable. #pragma warning disable CS8618 -// Disabled pending introductin to object initializers +// Disabled pending introduction to object initializers #pragma warning disable IDE0017 namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_17; diff --git a/src/Chapter06/Listing06.18.DefiningPropertiesWithExpressionBodiedMembers.cs b/src/Chapter06/Listing06.18.DefiningPropertiesWithExpressionBodiedMembers.cs index b3e1b96f..9e96e73b 100644 --- a/src/Chapter06/Listing06.18.DefiningPropertiesWithExpressionBodiedMembers.cs +++ b/src/Chapter06/Listing06.18.DefiningPropertiesWithExpressionBodiedMembers.cs @@ -1,6 +1,6 @@ // Non-nullable field is uninitialized. Consider declaring as nullable. #pragma warning disable CS8618 -// Disabled pending introductin to object initializers +// Disabled pending introduction to object initializers #pragma warning disable IDE0017 namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_18; diff --git a/src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs b/src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs index 6abbffb4..d8e7a438 100644 --- a/src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs +++ b/src/Chapter06/Listing06.22.DefiningCalculatedProperties.cs @@ -1,6 +1,6 @@ // Non-nullable field is uninitialized. Consider declaring as nullable. #pragma warning disable CS8618 // Pending a constructors -// Disabled pending introductin to object initializers +// Disabled pending introduction to object initializers #pragma warning disable IDE0017 namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter06.Listing06_22; diff --git a/src/Chapter07/Listing07.23.ConstantPatternWithSwitchExpression.cs b/src/Chapter07/Listing07.23.ConstantPatternWithSwitchExpression.cs index e39cba8a..869700c1 100644 --- a/src/Chapter07/Listing07.23.ConstantPatternWithSwitchExpression.cs +++ b/src/Chapter07/Listing07.23.ConstantPatternWithSwitchExpression.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter07.Listing07_23; #region INCLUDE using System.Diagnostics.CodeAnalysis; -public static class SolisticeHelper +public static class SolsticeHelper { public static bool IsSolstice( DateTime date) @@ -30,8 +30,8 @@ public static bool TryGetSolstice(DateTime date, { if ((solstice = date.Month switch { - 12 => "Winter Solistice", - 6 => "Summer Solistice", + 12 => "Winter Solstice", + 6 => "Summer Solstice", _ => null }) is not null) return true; } diff --git a/src/Chapter07/Listing07.25.LogicalPatternExamples.cs b/src/Chapter07/Listing07.25.LogicalPatternExamples.cs index 2eddc4cf..af2b5aa3 100644 --- a/src/Chapter07/Listing07.25.LogicalPatternExamples.cs +++ b/src/Chapter07/Listing07.25.LogicalPatternExamples.cs @@ -19,7 +19,7 @@ static bool TryGetPhoneButton( { '1' => '1', '2' or >= 'a' and <= 'c' => '2', - // not operator and parethesis example (C# 10) + // not operator and parenthesis example (C# 10) '3' or not (< 'd' or > 'f') => '3', '4' or >= 'g' and <= 'i' => '4', '5' or >= 'j' and <= 'l' => '5', diff --git a/src/Chapter07/Listing07.26.ParenthesizedPatternExamples.cs b/src/Chapter07/Listing07.26.ParenthesizedPatternExamples.cs index 47e208e5..c33abfeb 100644 --- a/src/Chapter07/Listing07.26.ParenthesizedPatternExamples.cs +++ b/src/Chapter07/Listing07.26.ParenthesizedPatternExamples.cs @@ -8,7 +8,7 @@ public class PeriodsOfTheDay public bool IsOutsideOfStandardWorkHours( TimeOnly time) => time.Hour is not - (> 8 and < 17 and not 12); // Parentbhesis Pattern - C# 10. + (> 8 and < 17 and not 12); // Parenthesis Pattern - C# 10. #endregion INCLUDE static bool TryGetPhoneButton( @@ -19,7 +19,7 @@ static bool TryGetPhoneButton( { '1' => '1', '2' or >= 'a' and <= 'c' => '2', - // not operator and parethesis example (C# 10) + // not operator and parenthesis example (C# 10) '3' or not (< 'd' or > 'f') => '3', '4' or >= 'g' and <= 'i' => '4', '5' or >= 'j' and <= 'l' => '5', diff --git a/src/Chapter07/Listing07.31.SwitchWithPatternMatching.cs b/src/Chapter07/Listing07.31.SwitchWithPatternMatching.cs index f4cb14dd..ebed5e07 100644 --- a/src/Chapter07/Listing07.31.SwitchWithPatternMatching.cs +++ b/src/Chapter07/Listing07.31.SwitchWithPatternMatching.cs @@ -4,7 +4,7 @@ public class Program { #region INCLUDE public static string? CompositeFormatDate( - object input, string compositFormatString) => + object input, string compositeFormatString) => input switch { DateTime @@ -24,7 +24,7 @@ public class Program ((int Year, int Month, int Day)?) null, _ => null } is (int, int, int) date ? string.Format( - compositFormatString, date.Year, date.Month, date.Day) : null; + compositeFormatString, date.Year, date.Month, date.Day) : null; #endregion INCLUDE } file static class DateDeconstructors diff --git a/src/Chapter07/Listing07.32.RecursivePatternMatching.cs b/src/Chapter07/Listing07.32.RecursivePatternMatching.cs index 90109771..e77fcfcc 100644 --- a/src/Chapter07/Listing07.32.RecursivePatternMatching.cs +++ b/src/Chapter07/Listing07.32.RecursivePatternMatching.cs @@ -29,7 +29,7 @@ public static void Main() (inigo, buttercup); if (couple is - ( // Tuple: Retrived from deconstructor of Person + ( // Tuple: Retrieved from deconstructor of Person ( // Positional: Select left side or tuple { // Property of firstName Length: int inigoFirstNameLength diff --git a/src/Chapter08/Listing08.04.CallingExplicitInterfaceMemberImplementations.cs b/src/Chapter08/Listing08.04.CallingExplicitInterfaceMemberImplementations.cs index f321a9e8..f20148b7 100644 --- a/src/Chapter08/Listing08.04.CallingExplicitInterfaceMemberImplementations.cs +++ b/src/Chapter08/Listing08.04.CallingExplicitInterfaceMemberImplementations.cs @@ -1,4 +1,4 @@ -// Justification: Only a aartial implmentation provided for elucidation purposes. +// Justification: Only a partial implementation provided for elucidation purposes. #pragma warning disable IDE0059 // Unnecessary assignment of a value namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter08.Listing08_04; diff --git a/src/Chapter08/Listing08.12.DefaultImplementedInterfaceMembers.cs b/src/Chapter08/Listing08.12.DefaultImplementedInterfaceMembers.cs index 00710dd4..ddf55fa6 100644 --- a/src/Chapter08/Listing08.12.DefaultImplementedInterfaceMembers.cs +++ b/src/Chapter08/Listing08.12.DefaultImplementedInterfaceMembers.cs @@ -240,8 +240,8 @@ private static int[] DisplayHeaders(string[] headers) private static void DisplayItemRow( int[] columnWidths, IListable item) { - string?[] columValues = item.CellValues; - if (columnWidths.Length != columValues.Length) + string?[] columnValues = item.CellValues; + if (columnWidths.Length != columnValues.Length) { throw new ArgumentOutOfRangeException( $"{ nameof(columnWidths) },{ nameof(item) }.{nameof(item.CellColors) }", @@ -251,9 +251,9 @@ private static void DisplayItemRow( // Exception handling excluded for elucidation ConsoleColor originalColor = Console.ForegroundColor; ConsoleColor[] itemColors = ((IListable)item).CellColors; - for (int index = 0; index < columValues.Length; index++) + for (int index = 0; index < columnValues.Length; index++) { - string itemToPrint = (columValues[index] ?? "").PadRight(columnWidths[index], ' '); + string itemToPrint = (columnValues[index] ?? "").PadRight(columnWidths[index], ' '); Console.ForegroundColor = itemColors[index]; Console.Write(itemToPrint); } diff --git a/src/Chapter08/Listing08.14.ForcingTheDesirableRunEncapsulation.cs b/src/Chapter08/Listing08.14.ForcingTheDesirableRunEncapsulation.cs index 2ec47774..b8002a0e 100644 --- a/src/Chapter08/Listing08.14.ForcingTheDesirableRunEncapsulation.cs +++ b/src/Chapter08/Listing08.14.ForcingTheDesirableRunEncapsulation.cs @@ -75,7 +75,7 @@ public static void Run() // implemented in the class. // ((IWorkflowActivity)this).InternalRun(); // activity.RedirectStandardInOut(); - // activity.ExecuteProcss(); + // activity.ExecuteProcess(); Console.WriteLine( @$"Executing non-polymorphic Run() with process '{ activity.ExecutableName}'."); diff --git a/src/Chapter08/Table08.01.DefaultImplementedInterfaceMembers.cs b/src/Chapter08/Table08.01.DefaultImplementedInterfaceMembers.cs index 40d07686..24dbb772 100644 --- a/src/Chapter08/Table08.01.DefaultImplementedInterfaceMembers.cs +++ b/src/Chapter08/Table08.01.DefaultImplementedInterfaceMembers.cs @@ -92,7 +92,7 @@ namespace ProtectedAccessModifiers } // 5. - namespace ProvateAccessModifiers + namespace PrivateAccessModifiers { public interface IPerson { @@ -158,7 +158,7 @@ private protected string GetName() => } public interface IEmployee: IPerson { - int EmpoyeeId => GetName().GetHashCode(); + int EmployeeId => GetName().GetHashCode(); } public class Person : IPerson { diff --git a/src/Chapter10/Listing10.02.AddingAnOperator.cs b/src/Chapter10/Listing10.02.AddingAnOperator.cs index 7b6caba3..6d1a2e50 100644 --- a/src/Chapter10/Listing10.02.AddingAnOperator.cs +++ b/src/Chapter10/Listing10.02.AddingAnOperator.cs @@ -54,7 +54,7 @@ public Coordinate(Longitude longitude, Latitude latitude) { // There is no need to check of null in this - // case because Coordinate is a valye type. + // case because Coordinate is a value type. return (leftHandSide.Equals(rightHandSide)); } diff --git a/src/Chapter10/Listing10.04.OverloadingTheMinusAndPlusUnaryOperators.cs b/src/Chapter10/Listing10.04.OverloadingTheMinusAndPlusUnaryOperators.cs index 97fa4373..d3d0cd23 100644 --- a/src/Chapter10/Listing10.04.OverloadingTheMinusAndPlusUnaryOperators.cs +++ b/src/Chapter10/Listing10.04.OverloadingTheMinusAndPlusUnaryOperators.cs @@ -36,7 +36,7 @@ public Coordinate(Longitude longitude, Latitude latitude) { // There is no need to check of null in this - // case because Coordinate is a valye type. + // case because Coordinate is a value type. return (leftHandSide.Equals(rightHandSide)); } diff --git a/src/Chapter12/Listing12.13.InitializingAFieldWithTheDefaultOperator.cs b/src/Chapter12/Listing12.13.InitializingAFieldWithTheDefaultOperator.cs index c3cff171..6941feda 100644 --- a/src/Chapter12/Listing12.13.InitializingAFieldWithTheDefaultOperator.cs +++ b/src/Chapter12/Listing12.13.InitializingAFieldWithTheDefaultOperator.cs @@ -1,4 +1,4 @@ -// Justification: Only showing partial implementaiton. +// Justification: Only showing partial implementation. #pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_13; @@ -11,7 +11,7 @@ public Pair(T first) { First = first; #region EXCLUDE - // Justifiction: Ignore warning pending struct/class constraints, later on in the chapter, + // Justification: Ignore warning pending struct/class constraints, later on in the chapter, // so that Second can be declared as T?. #pragma warning disable CS8601 // Possible null reference assignment. #endregion EXCLUDE diff --git a/src/Chapter12/Listing12.46.StackDeclaration.cs b/src/Chapter12/Listing12.46.StackDeclaration.cs index 933b1acd..beecf787 100644 --- a/src/Chapter12/Listing12.46.StackDeclaration.cs +++ b/src/Chapter12/Listing12.46.StackDeclaration.cs @@ -1,4 +1,4 @@ -// Justification: Only showing partial implementaiton. +// Justification: Only showing partial implementation. #pragma warning disable CS8618 // Non-nullable field is uninitialized. Consider declaring as nullable. namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_46; diff --git a/src/Chapter12/Listing12.49.StackIntDefinition.cs b/src/Chapter12/Listing12.49.StackIntDefinition.cs index 2affd30e..f58e9871 100644 --- a/src/Chapter12/Listing12.49.StackIntDefinition.cs +++ b/src/Chapter12/Listing12.49.StackIntDefinition.cs @@ -1,4 +1,4 @@ -// Justification: Only showing partial implementaiton. +// Justification: Only showing partial implementation. #pragma warning disable CS0168 // Variable is declared but never used diff --git a/src/Chapter13/Listing13.18.UsingVarianceForDelegates.cs b/src/Chapter13/Listing13.18.UsingVarianceForDelegates.cs index c24bdfb3..a1d3824e 100644 --- a/src/Chapter13/Listing13.18.UsingVarianceForDelegates.cs +++ b/src/Chapter13/Listing13.18.UsingVarianceForDelegates.cs @@ -1,4 +1,4 @@ -// Justification: Left as lamda to elucidate generic types. +// Justification: Left as lambda to elucidate generic types. #pragma warning disable IDE0039 // Use local function namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter13.Listing13_18; diff --git a/src/Chapter14/Listing14.05.InvokingADelegate.cs b/src/Chapter14/Listing14.05.InvokingADelegate.cs index ed860aea..bc75a579 100644 --- a/src/Chapter14/Listing14.05.InvokingADelegate.cs +++ b/src/Chapter14/Listing14.05.InvokingADelegate.cs @@ -17,7 +17,7 @@ public float CurrentTemperature _CurrentTemperature = value; // If there are any subscribers, // notify them of changes in - // temperature by invoking said subcribers + // temperature by invoking said subscribers #region HIGHLIGHT OnTemperatureChange?.Invoke(value); // C# 6.0 #endregion HIGHLIGHT diff --git a/src/Chapter14/Listing14.14.FiringTheEventNotification.cs b/src/Chapter14/Listing14.14.FiringTheEventNotification.cs index 37ea0fcc..eac50253 100644 --- a/src/Chapter14/Listing14.14.FiringTheEventNotification.cs +++ b/src/Chapter14/Listing14.14.FiringTheEventNotification.cs @@ -30,7 +30,7 @@ public float CurrentTemperature _CurrentTemperature = value; // If there are any subscribers, // notify them of changes in - // temperature by invoking said subcribers + // temperature by invoking said subscribers #region HIGHLIGHT OnTemperatureChange?.Invoke( this, new TemperatureArgs(value)); diff --git a/src/Chapter14/Listing14.17.CustomAddAndRemoveHandlers.cs b/src/Chapter14/Listing14.17.CustomAddAndRemoveHandlers.cs index c928053f..1d0ad82b 100644 --- a/src/Chapter14/Listing14.17.CustomAddAndRemoveHandlers.cs +++ b/src/Chapter14/Listing14.17.CustomAddAndRemoveHandlers.cs @@ -48,7 +48,7 @@ public float CurrentTemperature _CurrentTemperature = value; // If there are any subscribers, // notify them of changes in - // temperature by invoking said subcribers + // temperature by invoking said subscribers _OnTemperatureChange?.Invoke( // C# 6.0 this, new TemperatureArgs(value)); } diff --git a/src/Chapter17/Listing17.10.ChangingTheIndexersDefaultName.cs b/src/Chapter17/Listing17.10.ChangingTheIndexersDefaultName.cs index 90b9b50f..2cd5b948 100644 --- a/src/Chapter17/Listing17.10.ChangingTheIndexersDefaultName.cs +++ b/src/Chapter17/Listing17.10.ChangingTheIndexersDefaultName.cs @@ -31,9 +31,9 @@ public Pair(T first, T second) Second = second; } - public T First { get; } // C# 6.0 Getter-Only Autoproperty + public T First { get; } // C# 6.0 Getter-Only AutoProperty - public T Second { get; } // C# 6.0 Getter-Only Autoproperty + public T Second { get; } // C# 6.0 Getter-Only AutoProperty #region INCLUDE [System.Runtime.CompilerServices.IndexerName("Entry")] public T this[PairItem index] diff --git a/src/Chapter17/Listing17.15.UsingPair.GetEnumeratorViaForeach.cs b/src/Chapter17/Listing17.15.UsingPair.GetEnumeratorViaForeach.cs index 375d0973..f743547a 100644 --- a/src/Chapter17/Listing17.15.UsingPair.GetEnumeratorViaForeach.cs +++ b/src/Chapter17/Listing17.15.UsingPair.GetEnumeratorViaForeach.cs @@ -8,8 +8,8 @@ public class Program public static void Main() { #region INCLUDE - var fullname = new Pair("Inigo", "Montoya"); - foreach(string name in fullname) + var fullName = new Pair("Inigo", "Montoya"); + foreach(string name in fullName) { Console.WriteLine(name); } diff --git a/src/Chapter17/Listing17.16.PlacingYieldReturnStatementsWithinALoop.cs b/src/Chapter17/Listing17.16.PlacingYieldReturnStatementsWithinALoop.cs index 07c7047a..825d9842 100644 --- a/src/Chapter17/Listing17.16.PlacingYieldReturnStatementsWithinALoop.cs +++ b/src/Chapter17/Listing17.16.PlacingYieldReturnStatementsWithinALoop.cs @@ -45,7 +45,7 @@ public IEnumerator GetEnumerator() } #endregion #region EXCLUDE - public T Value { get; } // C# 6.0 Getter-only Autoproperty + public T Value { get; } // C# 6.0 Getter-only AutoProperty public Pair> SubItems { get; set; } #endregion EXCLUDE diff --git a/src/Chapter18/Listing18.09.DecoratingAPropertyWithMultipleAttributes.cs b/src/Chapter18/Listing18.09.DecoratingAPropertyWithMultipleAttributes.cs index cfd38a55..f0a795be 100644 --- a/src/Chapter18/Listing18.09.DecoratingAPropertyWithMultipleAttributes.cs +++ b/src/Chapter18/Listing18.09.DecoratingAPropertyWithMultipleAttributes.cs @@ -23,13 +23,13 @@ public System.Diagnostics.ProcessPriorityClass Priority #pragma warning disable CA1018 // Mark attributes with AttributeUsageAttribute internal class CommandLineSwitchRequiredAttribute : Attribute { - //not implimented + //not implemented } internal class CommandLineSwitchAliasAttribute : Attribute { public CommandLineSwitchAliasAttribute(string _) { - //not implimented + //not implemented } } diff --git a/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs b/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs index 15afe8c2..267a8a57 100644 --- a/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs +++ b/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs @@ -3,7 +3,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23; #region INCLUDE /* [Flags] -public enun FileAttributes +public enum FileAttributes { ReadOnly = 0x0001, Hidden = 0x0002, diff --git a/src/Chapter20/Listing20.16.IteratingOverAwaitOperation.cs b/src/Chapter20/Listing20.16.IteratingOverAwaitOperation.cs index 00e78ea1..13286545 100644 --- a/src/Chapter20/Listing20.16.IteratingOverAwaitOperation.cs +++ b/src/Chapter20/Listing20.16.IteratingOverAwaitOperation.cs @@ -18,7 +18,7 @@ private async void PingButton_Click( "www.partnersintl.org", "www.iassist.org", "www.fh.org", - "www.worldvision.org" + "www.worldVision.org" }; IPStatus status; diff --git a/src/Chapter21/Listing21.10.CancelingParallelLoop.cs b/src/Chapter21/Listing21.10.CancelingParallelLoop.cs index c45b14dd..621061c8 100644 --- a/src/Chapter21/Listing21.10.CancelingParallelLoop.cs +++ b/src/Chapter21/Listing21.10.CancelingParallelLoop.cs @@ -14,17 +14,17 @@ public static List ParallelEncrypt( List data, CancellationToken cancellationToken) { - int govener = 0; + int governor = 0; return data.AsParallel().WithCancellation( cancellationToken).Select( (item) => { if (Interlocked.CompareExchange( - ref govener, 0, 100) % 100 == 0) + ref governor, 0, 100) % 100 == 0) { Console.Write('.'); } - Interlocked.Increment(ref govener); + Interlocked.Increment(ref governor); return Encrypt(item); }).ToList(); } diff --git a/src/Chapter22/Listing22.08.ThreadSafeEventNotification.cs b/src/Chapter22/Listing22.08.ThreadSafeEventNotification.cs index 71033212..f4551c0d 100644 --- a/src/Chapter22/Listing22.08.ThreadSafeEventNotification.cs +++ b/src/Chapter22/Listing22.08.ThreadSafeEventNotification.cs @@ -28,7 +28,7 @@ public void Main() #endif } - // Justification: Lowercase to simulate the value keyword form a stetter. + // Justification: Lowercase to simulate the value keyword form a setter. #pragma warning disable IDE1006 // Naming Styles public object? value { get; set; } #pragma warning restore IDE1006 // Naming Styles diff --git a/src/Shared/Cryptographer.cs b/src/Shared/Cryptographer.cs index 1c26cd55..82d315dc 100644 --- a/src/Shared/Cryptographer.cs +++ b/src/Shared/Cryptographer.cs @@ -10,9 +10,9 @@ public class Cryptographer : IDisposable #endregion PROPERTIES #region CONSTRUCTORS - public Cryptographer(SymmetricAlgorithm cryptoAlgoritym) + public Cryptographer(SymmetricAlgorithm cryptoAlgorithm) { - CryptoAlgorithm = cryptoAlgoritym; + CryptoAlgorithm = cryptoAlgorithm; } public Cryptographer() diff --git a/src/Shared/Program.cs b/src/Shared/Program.cs index f34a0e29..2f04ec4e 100644 --- a/src/Shared/Program.cs +++ b/src/Shared/Program.cs @@ -140,7 +140,7 @@ public static async Task Main(string[] args) public static async ValueTask InvokeMethodUsingReflectionAsync(MethodInfo method, string[]? arguments) { - // Note: 'arguments' here are the array of commandline args, so + // Note: 'arguments' here are the array of commandLine args, so // it is the first item in the "parameters" array specified to the // Invoke method. object? result = method.Invoke(null,