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 2007-01-13, 12:48   #1 (permalink)
Portal Member
 
Join Date: Dec 2004
Location: Nuremberg
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Question Derive plugin from another plugin?

Hi everybody,

first of all: Many thanks to the mp team (developers, testers, docu writers). You are doing an awesome job!

I think that some of MPs very few problems that users still experience come from standby or hibernate issues due to faulty drivers or whatever. At least this is what I experience... So I decided to program a plugin that replaces PowerScheduler. It would allow to shutdown the computer completely and call an external program (CMOSTimer - see: http://www.boraxsoft.de/CMOSTimer_eng.html). This program would write the wakeup time to my pc's BIOS (like nvram-wakeup in linux). But I did not want to program everything from scratch because I thought that I would only have to override PowerSchedulers "Stop()" method in order to achieve my goals. The body of the Stop() method would call the external program CMOSTimer with the protected PowerScheduler variable "_wakeupTime" as parameter.

So I decided to derive a class called "BIOSScheduler" from "MediaPortal.PowerScheduler.Powerscheduler" and overrode some methods with the "new" keyword (e.g. PluginName(), Stop(), ...). But it seems that the respective methods from the base class "PowerScheduler" are called when configuration.exe and mediaportal.exe load the plugins. I think this is because the methods in the base classes are not declared as "virtual" and thus i cannot use the "override" keyword when I define the methods in the derived class (cf. Knowing When to Use Override and New Keywords (C# Programming Guide) in C# Visual Express Online Help).

Question to the mp team:
Am I doing something wrong or do you agree that it is currently not possible to derive a plugin from another plugin? If so: Would it be possible or do you think it is desirable to change maybe the IPlugin interface so that all methods are declared as virtual? I want to avoid copying the entire powerscheduler source just to add a small change to its functionality.

Hope that is not too confusing. Do you get my point?

Thanks in advance!
BartManson
bartmanson is online now   Reply With Quote
Old 2007-01-18, 10:50   #2 (permalink)
Portal Member
 
Join Date: Dec 2004
Location: Nuremberg
Posts: 62
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Default

Hi Guys,

anyone? Does no one else think that it would be nice if we could create new plugins by deriving them from existing plugins?

Ciao,
BartManson
bartmanson is online now   Reply With Quote
Reply

Bookmarks

Tags
derive, plugin

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
IPTV@UT Plugin moiristo Plugins 116 2008-10-06 22:32
Gathering topical infos about plugins (To: authors & use tomtom21000 Plugins 2 2006-02-05 00:20
Plugin example doesnt show in list Anonymous Plugins 5 2005-08-13 12:12
Plugin interface Anonymous Plugins 13 2004-09-15 18:25


All times are GMT +1. The time now is 12:57.


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