I would like to completely replace a method of a class that I did not write. I'm having difficulty finding an answer to this because I'm not sure what it's called, because I don't think it's technically considered overriding.
For example:
Say I have some code that uses the List object extensively in a lot of locations. Pretty often I'm calling the Sort method on these objects, but now I would like to change the implementation of the Sort method to preform some additional actions.
I could create a new class, MyList, that inherits from List and overrides the Sort method, but that would mean I have to go through all of my code and make sure I change all the List objects to MyList. This could create some issues since I am using List all over the place and could easily miss a few objects
This isn't the literal case, but hopefully the example makes sense. I know what I'm trying to do may be considered bad design, but I'd still like to know if this is possible.