is this possible? replacing a core mp function by plugin? (1 Viewer)

zombiepig

Portal Pro
March 21, 2005
408
0
Melb, Aus
Home Country
I've started working on my first mp plugin. while i've had quite a bit of experience programming in other languages this is the first i've really sunk my teeth into c#.

now my question is - is it possible to replace a function defined by mp with a custom one from a plugin? i'd like my plugin to change the mediaportal.GUI.Video.GUIVideoFiles.OnClick function operates. What i'm really hoping for is that i can override this function with one that's included in my plugin.

Is this sort of thing even possible? :p How would i go about doing it?
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
Event handlers won't help you much there because you can't stop another event handler from being called. Hence you can't replace the function.

Its a tricky situation - the only real solution that I can think of is to create a new plugin by inheriting from the GUIVideoFiles screen, then try overriding the OnClick function (can't remember if overriding a function is available by default). Even so, that could lead to other issues. Otherwise, you can try to use reflection to reverse the effects of the OnClick function.

The easiest solution would probably be to submit a patch to MP that either changes the OnClick function to your liking, or changes the OnClick function such that it can hook into whatever other function you want it to do.

Sam
 

Users who are viewing this thread

Top Bottom