Im currently working on a c# project that uses another .net library. This library does (amongst other things) parse a sequence into a tree. All items are of some type that inherits from the abstract class Sequence
. I needed to alter the behaviour slightly and subclassed Sequence
myself (lets call it MySequence
). After the tree was created, I could replace some tree nodes with objects of my own class.
Now, a new version of the library was published, and a Copy
function with the following signature was introduced:
internal abstract Sequence Copy();
I tried to adopt my code to the new version and override it, but whatever I am doing, I get the two errors:
MySequence
does not implement inherited abstract member 'Sequence.Copy()
'
and:
MySequence.Copy()
': no suitable method found to override
This makes sense, since it is abstract (--> it must be overwritten) and internal (--> it can not be overwritten, due to hidden visibility from outside the assembly)
So, the problem is, I understand why this is happening, but dont know what to do against it. It is crucial for my project to subclass Sequence
.
And what I also dont understand is, why the internal abstract
modfier is allowed in the first place as it basically permits any subclassing of the whole class from outside the assembly!?
Is there any way to solve this? Via reflection or something?
Thanks in advance!