| |||||||
| Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: Mar 2005 Location: Melb, Aus Age: 27
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts
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? How would i go about doing it? |
| | |
| | #3 (permalink) |
| Portal Member Join Date: Aug 2004 Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts
| 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 |
| | |
![]() |
| Bookmarks |
| Tags |
| core, function, plugin, replacing |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WinTV HVR-3000 unsupported??? | papakai | General Support | 14 | 2006-12-08 18:06 |
| Gathering topical infos about plugins (To: authors & use | tomtom21000 | Plugins | 2 | 2006-02-05 00:20 |
| noob question - writing a plugin in VB | ghackett | Plugins | 3 | 2005-12-02 18:01 |
| Plugin example doesnt show in list | Anonymous | Plugins | 5 | 2005-08-13 12:12 |