From 3c1817c82eaadbed97f59b8ea9a0b4025398ebfa Mon Sep 17 00:00:00 2001 From: Mark Michaelis Date: Thu, 21 Sep 2023 09:58:02 +0100 Subject: [PATCH] Resubmit Chapter 18 after Renumber (#553) --- ...pecificAttributeAndCheckingItsInitialization.Tests.cs} | 6 +++--- ...25.UsingConditionalAttributeToEliminateACall.Tests.cs} | 6 +++--- ...es.Tests.cs => Listing18.27.GenericException.Tests.cs} | 2 +- ....cs => Listing18.28.CallerArgumentExpression.Tests.cs} | 2 +- ...sting18.29.DynamicProgrammingUsingReflection.Tests.cs} | 2 +- ...30.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs} | 2 +- ...Listing18.31.RuntimeBindingToXMLWithDynamics.Tests.cs} | 2 +- src/Chapter18/Chapter18.csproj | 8 ++++---- ....csprojMockFileForResequencingListings.Placeholder.cs} | 2 +- ...ribute.cs => Listing18.14.DefiningACustomAttribute.cs} | 2 +- ...bute.cs => Listing18.15.RetrievingACustomAttribute.cs} | 2 +- ...cs => Listing18.16.ProvidingAnAttributeConstructor.cs} | 2 +- ...vingASpecificAttributeAndCheckingItsInitialization.cs} | 4 ++-- ...=> Listing18.18.RetrievingCustomAttributeInstances.cs} | 2 +- ...UpdatingCommandLineHandler.TryParseToHandleAliases.cs} | 4 ++-- ....20.RestrictingTheConstructsAnAttributeCanDecorate.cs} | 2 +- ...teUsageAttributeRestrictingWhereToApplyAnAttribute.cs} | 2 +- ...mitingAnAttributesUsageWithAttributeUsageAttribute.cs} | 2 +- ...dParameter.cs => Listing18.23.UsingANamedParameter.cs} | 2 +- ...gsAttribute.cs => Listing18.24.UsingFlagsAttribute.cs} | 2 +- ...ing18.25.UsingConditionalAttributeToEliminateACall.cs} | 2 +- ...ttribute.cs => Listing18.26.UsingObsoleteAttribute.cs} | 2 +- ...ericAttributes.cs => Listing18.27.GenericException.cs} | 7 ++----- ...ession.cs => Listing18.28.CallerArgumentExpression.cs} | 2 +- ... => Listing18.29.DynamicProgrammingUsingReflection.cs} | 2 +- ...ing18.30.RuntimeBindingToXMLElementsWithoutDynamic.cs} | 2 +- ...cs => Listing18.31.RuntimeBindingToXMLWithDynamics.cs} | 4 ++-- ...s => Listing18.32.ImplementingACustomDynamicObject.cs} | 2 +- ...3.OverridableMembersOnSystem.Dynamic.DynamicObject.cs} | 2 +- 29 files changed, 40 insertions(+), 43 deletions(-) rename src/Chapter18.Tests/{Listing18.16.Tests.cs => Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs} (80%) rename src/Chapter18.Tests/{Listing18.24.Tests.cs => Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs} (82%) rename src/Chapter18.Tests/{Listing18.26.GenericAttributes.Tests.cs => Listing18.27.GenericException.Tests.cs} (97%) rename src/Chapter18.Tests/{Listing18.27.CallerArgumentExpression.Tests.cs => Listing18.28.CallerArgumentExpression.Tests.cs} (99%) rename src/Chapter18.Tests/{Listing18.28.DynamicProgrammingUsingReflection.Tests.cs => Listing18.29.DynamicProgrammingUsingReflection.Tests.cs} (96%) rename src/Chapter18.Tests/{Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs => Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs} (95%) rename src/Chapter18.Tests/{Listing18.30.RuntimeBindingToXMLWithDynamics.Tests.cs => Listing18.31.RuntimeBindingToXMLWithDynamics.Tests.cs} (95%) rename src/Chapter18/{Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs => Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs} (96%) rename src/Chapter18/{Listing18.13.DefiningACustomAttribute.cs => Listing18.14.DefiningACustomAttribute.cs} (94%) rename src/Chapter18/{Listing18.14.RetrievingACustomAttribute.cs => Listing18.15.RetrievingACustomAttribute.cs} (98%) rename src/Chapter18/{Listing18.15.ProvidingAnAttributeConstructor.cs => Listing18.16.ProvidingAnAttributeConstructor.cs} (98%) rename src/Chapter18/{Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs => Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs} (97%) rename src/Chapter18/{Listing18.17.RetrievingCustomAttributeInstances.cs => Listing18.18.RetrievingCustomAttributeInstances.cs} (99%) rename src/Chapter18/{Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs => Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs} (99%) rename src/Chapter18/{Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs => Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs} (95%) rename src/Chapter18/{Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs => Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs} (96%) rename src/Chapter18/{Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs => Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs} (97%) rename src/Chapter18/{Listing18.22.UsingANamedParameter.cs => Listing18.23.UsingANamedParameter.cs} (95%) rename src/Chapter18/{Listing18.23.UsingFlagsAttribute.cs => Listing18.24.UsingFlagsAttribute.cs} (98%) rename src/Chapter18/{Listing18.24.UsingConditionalAttributeToEliminateACall.cs => Listing18.25.UsingConditionalAttributeToEliminateACall.cs} (98%) rename src/Chapter18/{Listing18.25.UsingObsoleteAttribute.cs => Listing18.26.UsingObsoleteAttribute.cs} (96%) rename src/Chapter18/{Listing18.26.GenericAttributes.cs => Listing18.27.GenericException.cs} (94%) rename src/Chapter18/{Listing18.27.CallerArgumentExpression.cs => Listing18.28.CallerArgumentExpression.cs} (99%) rename src/Chapter18/{Listing18.28.DynamicProgrammingUsingReflection.cs => Listing18.29.DynamicProgrammingUsingReflection.cs} (98%) rename src/Chapter18/{Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.cs => Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.cs} (98%) rename src/Chapter18/{Listing18.30.RuntimeBindingToXMLWithDynamics.cs => Listing18.31.RuntimeBindingToXMLWithDynamics.cs} (93%) rename src/Chapter18/{Listing18.31.ImplementingACustomDynamicObject.cs => Listing18.32.ImplementingACustomDynamicObject.cs} (99%) rename src/Chapter18/{Listing18.32.OverridableMembersOnSystem.Dynamic.DynamicObject.cs => Listing18.33.OverridableMembersOnSystem.Dynamic.DynamicObject.cs} (99%) diff --git a/src/Chapter18.Tests/Listing18.16.Tests.cs b/src/Chapter18.Tests/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs similarity index 80% rename from src/Chapter18.Tests/Listing18.16.Tests.cs rename to src/Chapter18.Tests/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs index e7ef66ebc..385d14948 100644 --- a/src/Chapter18.Tests/Listing18.16.Tests.cs +++ b/src/Chapter18.Tests/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.Tests.cs @@ -1,6 +1,6 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17.Tests; [TestClass] public class ProgramTests @@ -13,4 +13,4 @@ public void MainTest() IntelliTect.TestTools.Console.ConsoleAssert.Expect( expected, Program.Main); } -} \ No newline at end of file +} diff --git a/src/Chapter18.Tests/Listing18.24.Tests.cs b/src/Chapter18.Tests/Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs similarity index 82% rename from src/Chapter18.Tests/Listing18.24.Tests.cs rename to src/Chapter18.Tests/Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs index c0f24b7e4..1fe007a7f 100644 --- a/src/Chapter18.Tests/Listing18.24.Tests.cs +++ b/src/Chapter18.Tests/Listing18.25.UsingConditionalAttributeToEliminateACall.Tests.cs @@ -1,6 +1,6 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25.Tests; [TestClass] public class ProgramTests @@ -15,4 +15,4 @@ public void MainTest() IntelliTect.TestTools.Console.ConsoleAssert.Expect( expected, Program.Main); } -} \ No newline at end of file +} diff --git a/src/Chapter18.Tests/Listing18.26.GenericAttributes.Tests.cs b/src/Chapter18.Tests/Listing18.27.GenericException.Tests.cs similarity index 97% rename from src/Chapter18.Tests/Listing18.26.GenericAttributes.Tests.cs rename to src/Chapter18.Tests/Listing18.27.GenericException.Tests.cs index 902709e4c..b4f07bb66 100644 --- a/src/Chapter18.Tests/Listing18.26.GenericAttributes.Tests.cs +++ b/src/Chapter18.Tests/Listing18.27.GenericException.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27.Tests; #if NET7_0_OR_GREATER [TestClass] diff --git a/src/Chapter18.Tests/Listing18.27.CallerArgumentExpression.Tests.cs b/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs similarity index 99% rename from src/Chapter18.Tests/Listing18.27.CallerArgumentExpression.Tests.cs rename to src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs index e919f6c96..9eb8b2c55 100644 --- a/src/Chapter18.Tests/Listing18.27.CallerArgumentExpression.Tests.cs +++ b/src/Chapter18.Tests/Listing18.28.CallerArgumentExpression.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests; #if NET7_0_OR_GREATER [TestClass] diff --git a/src/Chapter18.Tests/Listing18.28.DynamicProgrammingUsingReflection.Tests.cs b/src/Chapter18.Tests/Listing18.29.DynamicProgrammingUsingReflection.Tests.cs similarity index 96% rename from src/Chapter18.Tests/Listing18.28.DynamicProgrammingUsingReflection.Tests.cs rename to src/Chapter18.Tests/Listing18.29.DynamicProgrammingUsingReflection.Tests.cs index 9a866d020..71124abdf 100644 --- a/src/Chapter18.Tests/Listing18.28.DynamicProgrammingUsingReflection.Tests.cs +++ b/src/Chapter18.Tests/Listing18.29.DynamicProgrammingUsingReflection.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29.Tests; [TestClass] public class ProgramTests diff --git a/src/Chapter18.Tests/Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs b/src/Chapter18.Tests/Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs similarity index 95% rename from src/Chapter18.Tests/Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs rename to src/Chapter18.Tests/Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs index 8316cfc9d..cd8167d9f 100644 --- a/src/Chapter18.Tests/Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs +++ b/src/Chapter18.Tests/Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30.Tests; [TestClass] public class ProgramTests diff --git a/src/Chapter18.Tests/Listing18.30.RuntimeBindingToXMLWithDynamics.Tests.cs b/src/Chapter18.Tests/Listing18.31.RuntimeBindingToXMLWithDynamics.Tests.cs similarity index 95% rename from src/Chapter18.Tests/Listing18.30.RuntimeBindingToXMLWithDynamics.Tests.cs rename to src/Chapter18.Tests/Listing18.31.RuntimeBindingToXMLWithDynamics.Tests.cs index 90b2e1786..717b594a7 100644 --- a/src/Chapter18.Tests/Listing18.30.RuntimeBindingToXMLWithDynamics.Tests.cs +++ b/src/Chapter18.Tests/Listing18.31.RuntimeBindingToXMLWithDynamics.Tests.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30.Tests; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_31.Tests; [TestClass] public class ProgramTests diff --git a/src/Chapter18/Chapter18.csproj b/src/Chapter18/Chapter18.csproj index f0dfe4c1f..4c92fe39f 100644 --- a/src/Chapter18/Chapter18.csproj +++ b/src/Chapter18/Chapter18.csproj @@ -1,4 +1,4 @@ - + 18 @@ -14,8 +14,8 @@ - - + + Program.cs @@ -29,6 +29,6 @@ DoWorkEventArgs.cs - + diff --git a/src/Chapter18/Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs b/src/Chapter18/Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs similarity index 96% rename from src/Chapter18/Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs rename to src/Chapter18/Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs index 6a5d1153e..f556aeb25 100644 --- a/src/Chapter18/Listing18.12.csprojMockFileForResequencingListings.Placeholder.cs +++ b/src/Chapter18/Listing18.13.csprojMockFileForResequencingListings.Placeholder.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_12; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_13; //Allows for the csproj file listing example to be accounted for when resequencing listings. just rename this diff --git a/src/Chapter18/Listing18.13.DefiningACustomAttribute.cs b/src/Chapter18/Listing18.14.DefiningACustomAttribute.cs similarity index 94% rename from src/Chapter18/Listing18.13.DefiningACustomAttribute.cs rename to src/Chapter18/Listing18.14.DefiningACustomAttribute.cs index 1c8874a4a..b2054f8f6 100644 --- a/src/Chapter18/Listing18.13.DefiningACustomAttribute.cs +++ b/src/Chapter18/Listing18.14.DefiningACustomAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_13; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_14; #region INCLUDE public class CommandLineSwitchRequiredAttribute : Attribute diff --git a/src/Chapter18/Listing18.14.RetrievingACustomAttribute.cs b/src/Chapter18/Listing18.15.RetrievingACustomAttribute.cs similarity index 98% rename from src/Chapter18/Listing18.14.RetrievingACustomAttribute.cs rename to src/Chapter18/Listing18.15.RetrievingACustomAttribute.cs index de95efd07..cb75dec97 100644 --- a/src/Chapter18/Listing18.14.RetrievingACustomAttribute.cs +++ b/src/Chapter18/Listing18.15.RetrievingACustomAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_14; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15; #region INCLUDE using System.Reflection; diff --git a/src/Chapter18/Listing18.15.ProvidingAnAttributeConstructor.cs b/src/Chapter18/Listing18.16.ProvidingAnAttributeConstructor.cs similarity index 98% rename from src/Chapter18/Listing18.15.ProvidingAnAttributeConstructor.cs rename to src/Chapter18/Listing18.16.ProvidingAnAttributeConstructor.cs index 4e47f2541..6999f2219 100644 --- a/src/Chapter18/Listing18.15.ProvidingAnAttributeConstructor.cs +++ b/src/Chapter18/Listing18.16.ProvidingAnAttributeConstructor.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16; #region INCLUDE public class CommandLineSwitchAliasAttribute : Attribute diff --git a/src/Chapter18/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs b/src/Chapter18/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs similarity index 97% rename from src/Chapter18/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs rename to src/Chapter18/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs index 7f2cfcd58..350d0d664 100644 --- a/src/Chapter18/Listing18.16.RetrievingASpecificAttributeAndCheckingItsInitialization.cs +++ b/src/Chapter18/Listing18.17.RetrievingASpecificAttributeAndCheckingItsInitialization.cs @@ -1,6 +1,6 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17; -using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_15; +using AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_16; using System.Reflection; public class Program diff --git a/src/Chapter18/Listing18.17.RetrievingCustomAttributeInstances.cs b/src/Chapter18/Listing18.18.RetrievingCustomAttributeInstances.cs similarity index 99% rename from src/Chapter18/Listing18.17.RetrievingCustomAttributeInstances.cs rename to src/Chapter18/Listing18.18.RetrievingCustomAttributeInstances.cs index 1d6d80569..517748baf 100644 --- a/src/Chapter18/Listing18.17.RetrievingCustomAttributeInstances.cs +++ b/src/Chapter18/Listing18.18.RetrievingCustomAttributeInstances.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_17; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_18; #region INCLUDE using System.Reflection; diff --git a/src/Chapter18/Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs b/src/Chapter18/Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs similarity index 99% rename from src/Chapter18/Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs rename to src/Chapter18/Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs index 9f345bcd8..1a3f1c47c 100644 --- a/src/Chapter18/Listing18.18.UpdatingCommandLineHandler.TryParseToHandleAliases.cs +++ b/src/Chapter18/Listing18.19.UpdatingCommandLineHandler.TryParseToHandleAliases.cs @@ -1,6 +1,6 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_18; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_19; -using Listing18_17; +using Listing18_18; #region INCLUDE using System.Reflection; using System.Collections.Generic; diff --git a/src/Chapter18/Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs b/src/Chapter18/Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs similarity index 95% rename from src/Chapter18/Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs rename to src/Chapter18/Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs index d43846bf5..a5d6d6c30 100644 --- a/src/Chapter18/Listing18.19.RestrictingTheConstructsAnAttributeCanDecorate.cs +++ b/src/Chapter18/Listing18.20.RestrictingTheConstructsAnAttributeCanDecorate.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_19; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_20; #region INCLUDE [AttributeUsage(AttributeTargets.Property)] diff --git a/src/Chapter18/Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs b/src/Chapter18/Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs similarity index 96% rename from src/Chapter18/Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs rename to src/Chapter18/Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs index 606196aa4..dd6978287 100644 --- a/src/Chapter18/Listing18.20.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs +++ b/src/Chapter18/Listing18.21.AttributeUsageAttributeRestrictingWhereToApplyAnAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_20; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_21; // Will not compile if uncommented /* diff --git a/src/Chapter18/Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs b/src/Chapter18/Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs similarity index 97% rename from src/Chapter18/Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs rename to src/Chapter18/Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs index e050de1f8..3676b0826 100644 --- a/src/Chapter18/Listing18.21.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs +++ b/src/Chapter18/Listing18.22.LimitingAnAttributesUsageWithAttributeUsageAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_21; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_22; #region INCLUDE // Restrict the attribute to properties and methods diff --git a/src/Chapter18/Listing18.22.UsingANamedParameter.cs b/src/Chapter18/Listing18.23.UsingANamedParameter.cs similarity index 95% rename from src/Chapter18/Listing18.22.UsingANamedParameter.cs rename to src/Chapter18/Listing18.23.UsingANamedParameter.cs index 4e6997b34..c035f7ee0 100644 --- a/src/Chapter18/Listing18.22.UsingANamedParameter.cs +++ b/src/Chapter18/Listing18.23.UsingANamedParameter.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_22; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23; #region INCLUDE [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] diff --git a/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs b/src/Chapter18/Listing18.24.UsingFlagsAttribute.cs similarity index 98% rename from src/Chapter18/Listing18.23.UsingFlagsAttribute.cs rename to src/Chapter18/Listing18.24.UsingFlagsAttribute.cs index 15afe8c2d..137200e80 100644 --- a/src/Chapter18/Listing18.23.UsingFlagsAttribute.cs +++ b/src/Chapter18/Listing18.24.UsingFlagsAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_23; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24; #region INCLUDE /* diff --git a/src/Chapter18/Listing18.24.UsingConditionalAttributeToEliminateACall.cs b/src/Chapter18/Listing18.25.UsingConditionalAttributeToEliminateACall.cs similarity index 98% rename from src/Chapter18/Listing18.24.UsingConditionalAttributeToEliminateACall.cs rename to src/Chapter18/Listing18.25.UsingConditionalAttributeToEliminateACall.cs index 0cf0353d8..daba8cc60 100644 --- a/src/Chapter18/Listing18.24.UsingConditionalAttributeToEliminateACall.cs +++ b/src/Chapter18/Listing18.25.UsingConditionalAttributeToEliminateACall.cs @@ -1,7 +1,7 @@ #region INCLUDE #define CONDITION_A #region EXCLUDE -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_24; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25; #endregion EXCLUDE using System.Diagnostics; diff --git a/src/Chapter18/Listing18.25.UsingObsoleteAttribute.cs b/src/Chapter18/Listing18.26.UsingObsoleteAttribute.cs similarity index 96% rename from src/Chapter18/Listing18.25.UsingObsoleteAttribute.cs rename to src/Chapter18/Listing18.26.UsingObsoleteAttribute.cs index 8eecc5962..2f8ca5414 100644 --- a/src/Chapter18/Listing18.25.UsingObsoleteAttribute.cs +++ b/src/Chapter18/Listing18.26.UsingObsoleteAttribute.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_25; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26; #region INCLUDE public class Program diff --git a/src/Chapter18/Listing18.26.GenericAttributes.cs b/src/Chapter18/Listing18.27.GenericException.cs similarity index 94% rename from src/Chapter18/Listing18.26.GenericAttributes.cs rename to src/Chapter18/Listing18.27.GenericException.cs index fb5a72ef5..0eafbe330 100644 --- a/src/Chapter18/Listing18.26.GenericAttributes.cs +++ b/src/Chapter18/Listing18.27.GenericException.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_26; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27; #if NET7_0_OR_GREATER #region INCLUDE @@ -19,7 +19,6 @@ public class ExpectedException : Attribute where TException : Exception #endregion HIGHLIGHT { - #region EXCLUDE public static TException AssertExceptionThrown(Action testMethod) { try @@ -34,10 +33,8 @@ public static TException AssertExceptionThrown(Action testMethod) return exception; } } - - // Attribute detection - #endregion EXCLUDE + // Attribute detection // ... } #endregion INCLUDE diff --git a/src/Chapter18/Listing18.27.CallerArgumentExpression.cs b/src/Chapter18/Listing18.28.CallerArgumentExpression.cs similarity index 99% rename from src/Chapter18/Listing18.27.CallerArgumentExpression.cs rename to src/Chapter18/Listing18.28.CallerArgumentExpression.cs index b0e255beb..8391d837f 100644 --- a/src/Chapter18/Listing18.27.CallerArgumentExpression.cs +++ b/src/Chapter18/Listing18.28.CallerArgumentExpression.cs @@ -1,6 +1,6 @@ using System.Runtime.CompilerServices; -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_27; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; #if NET7_0_OR_GREATER #region INCLUDE diff --git a/src/Chapter18/Listing18.28.DynamicProgrammingUsingReflection.cs b/src/Chapter18/Listing18.29.DynamicProgrammingUsingReflection.cs similarity index 98% rename from src/Chapter18/Listing18.28.DynamicProgrammingUsingReflection.cs rename to src/Chapter18/Listing18.29.DynamicProgrammingUsingReflection.cs index 1d54f7076..3fe54e476 100644 --- a/src/Chapter18/Listing18.28.DynamicProgrammingUsingReflection.cs +++ b/src/Chapter18/Listing18.29.DynamicProgrammingUsingReflection.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_28; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29; public class Program { diff --git a/src/Chapter18/Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.cs b/src/Chapter18/Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.cs similarity index 98% rename from src/Chapter18/Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.cs rename to src/Chapter18/Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.cs index 2a87e91e8..b5f545113 100644 --- a/src/Chapter18/Listing18.29.RuntimeBindingToXMLElementsWithoutDynamic.cs +++ b/src/Chapter18/Listing18.30.RuntimeBindingToXMLElementsWithoutDynamic.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_29; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30; #region INCLUDE using System.Xml.Linq; diff --git a/src/Chapter18/Listing18.30.RuntimeBindingToXMLWithDynamics.cs b/src/Chapter18/Listing18.31.RuntimeBindingToXMLWithDynamics.cs similarity index 93% rename from src/Chapter18/Listing18.30.RuntimeBindingToXMLWithDynamics.cs rename to src/Chapter18/Listing18.31.RuntimeBindingToXMLWithDynamics.cs index a5ad68082..8feda5ce1 100644 --- a/src/Chapter18/Listing18.30.RuntimeBindingToXMLWithDynamics.cs +++ b/src/Chapter18/Listing18.31.RuntimeBindingToXMLWithDynamics.cs @@ -1,6 +1,6 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_30; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_31; -using Listing18_31; +using Listing18_32; public class Program { public static void Main() diff --git a/src/Chapter18/Listing18.31.ImplementingACustomDynamicObject.cs b/src/Chapter18/Listing18.32.ImplementingACustomDynamicObject.cs similarity index 99% rename from src/Chapter18/Listing18.31.ImplementingACustomDynamicObject.cs rename to src/Chapter18/Listing18.32.ImplementingACustomDynamicObject.cs index c02a24c57..9f934d2df 100644 --- a/src/Chapter18/Listing18.31.ImplementingACustomDynamicObject.cs +++ b/src/Chapter18/Listing18.32.ImplementingACustomDynamicObject.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_31; +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_32; #region INCLUDE using System.Dynamic; diff --git a/src/Chapter18/Listing18.32.OverridableMembersOnSystem.Dynamic.DynamicObject.cs b/src/Chapter18/Listing18.33.OverridableMembersOnSystem.Dynamic.DynamicObject.cs similarity index 99% rename from src/Chapter18/Listing18.32.OverridableMembersOnSystem.Dynamic.DynamicObject.cs rename to src/Chapter18/Listing18.33.OverridableMembersOnSystem.Dynamic.DynamicObject.cs index 46b23bb92..e68a6f8b3 100644 --- a/src/Chapter18/Listing18.32.OverridableMembersOnSystem.Dynamic.DynamicObject.cs +++ b/src/Chapter18/Listing18.33.OverridableMembersOnSystem.Dynamic.DynamicObject.cs @@ -1,4 +1,4 @@ -namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_32 +namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter18.Listing18_33 { #region INCLUDE using System.Collections.Generic;