MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Community Skins and Plugins » Plugins


Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here.

Reply
 
Thread Tools Display Modes
Old 2006-06-13, 07:15   #1 (permalink)
Portal Member
 
zombiepig's Avatar
 
Join Date: Mar 2005
Location: Melb, Aus
Age: 27
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default is this possible? replacing a core mp function by plugin?

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?
zombiepig is offline   Reply With Quote
Old 2006-07-14, 16:19   #2 (permalink)
Portal Member
 
Join Date: Jul 2006
Location: GER - Bremen
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Search MSDN for Event Handlers....
TNDAri is offline   Reply With Quote
Old 2006-07-16, 10:34   #3 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts


Default

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
samuel337 is offline   Reply With Quote
Reply

Bookmarks

Tags
core, function, plugin, replacing

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

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


All times are GMT +1. The time now is 05:24.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden