I am confused about how best to 'capture' the values of some Strategy Properties into an instance of a class.
What I want to do is use the values of some properties as the "base" parameters in my logic but also have them over written by some other Strategy Properties depending on the situation.
I want to make a new class whose constructor would create default values copying the "base" parameters but received an error that I need an instance of the strategy. I tried supplying 'this.' in several different ways but I couldn't figure it out.
One solution presented by Visual Studio was to turn the Strategy Properties into static ones and it seemed like it would work but I read a post that NT is not built with static variables in mind.
As a laborious workaround, I made a method that would create a new blank class and then populate the values using the "base" parameters. This should work but any time in the future if I change the Strategy Properties, I'll have to change the class as well as the method.
So, some final questions:
1. How can I correctly access the current instance of the Strategy Properties in a class constructor?
2. Would turning the Strategy Properties into static ones cause any problems?
3. What version of C# and .NET does the most recent NT8 use?
4. Is there a better way to do this?
Thanks!
Comment