home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Plugin example doesnt show in list
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Anonymous" data-source="post: 19228"><p>Hi,</p><p></p><p>Ive been programming for some time now in C# and wanted to try and build a plugin for mediaportal (which ive been using for a bit longer).</p><p></p><p>I found the tutorial at <a href="http://mediaportal.sourceforge.net/PluginTutorial/PluginTutorial.htm" target="_blank">http://mediaportal.sourceforge.net/PluginTutorial/PluginTutorial.htm</a> which compiled fine, but it doesnt show up at the plugin list :\</p><p>Edit: The <strong>log</strong> says: <strong>Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.</strong></p><p></p><p>Ive searched the forum for a solution, but havent been lucky yet. Can anyone help me out?</p><p></p><p>Ive attached the code Ive compiled using Visual C# 2005 Express.</p><p></p><p>[code]using System;</p><p>using System.Windows.Forms;</p><p>using MediaPortal.GUI.Library;</p><p></p><p>namespace SomePlugin</p><p>{</p><p> /// <summary></p><p> /// Summary description for Class1.</p><p> /// </summary></p><p> public class PluginClass : GUIWindow, ISetupForm</p><p> {</p><p> public PluginClass()</p><p> {</p><p> //</p><p> // TODO: Add constructor logic here</p><p> //</p><p> }</p><p> #region ISetupForm Members</p><p> </p><p> // Returns the name of the plugin which is shown in the plugin menu</p><p> public string PluginName()</p><p> {</p><p> return "PluginClass";</p><p> }</p><p> </p><p> // Returns the description of the plugin is shown in the plugin menu</p><p> public string Description()</p><p> {</p><p> return "Does stuff.";</p><p> }</p><p> </p><p> // Returns the author of the plugin which is shown in the plugin menu</p><p> public string Author() </p><p> {</p><p> return "me";</p><p> } </p><p> </p><p> // show the setup dialog</p><p> public void ShowPlugin() </p><p> {</p><p> MessageBox.Show("Nothing to configure yet!");</p><p> } </p><p> </p><p> // Indicates whether plugin can be enabled/disabled</p><p> public bool CanEnable() </p><p> {</p><p> return true;</p><p> } </p><p> </p><p> // get ID of windowplugin belonging to this setup</p><p> public int GetWindowId()</p><p> {</p><p> return 5678;</p><p> } </p><p> </p><p> // Indicates if plugin is enabled by default;</p><p> public bool DefaultEnabled()</p><p> {</p><p> return true;</p><p> } </p><p> </p><p> </p><p> </p><p> // indicates if a plugin has its own setup screen</p><p> public bool HasSetup() </p><p> {</p><p> return true;</p><p> } </p><p> </p><p> /// <summary></p><p> /// If the plugin should have its own button on the main menu of Media Portal then it</p><p> /// should return true to this method, otherwise if it should not be on home</p><p> /// it should return false</p><p> /// </summary></p><p> /// <param name="strButtonText">text the button should have</param></p><p> /// <param name="strButtonImage">image for the button, or empty for default</param></p><p> /// <param name="strButtonImageFocus">image for the button, or empty for default</param></p><p> /// <param name="strPictureImage">subpicture for the button or empty for none</param></p><p> /// <returns>true : plugin needs its own button on home</p><p> /// false : plugin does not need its own button on home</returns></p><p> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)</p><p> {</p><p> strButtonText=String.Empty;</p><p> strButtonImage=String.Empty;</p><p> strButtonImageFocus=String.Empty;</p><p> strPictureImage=String.Empty;</p><p> return false;</p><p> }</p><p> #endregion</p><p> }</p><p>}[/code]</p></blockquote><p></p>
[QUOTE="Anonymous, post: 19228"] Hi, Ive been programming for some time now in C# and wanted to try and build a plugin for mediaportal (which ive been using for a bit longer). I found the tutorial at [url]http://mediaportal.sourceforge.net/PluginTutorial/PluginTutorial.htm[/url] which compiled fine, but it doesnt show up at the plugin list :\ Edit: The [b]log[/b] says: [b]Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.[/b] Ive searched the forum for a solution, but havent been lucky yet. Can anyone help me out? Ive attached the code Ive compiled using Visual C# 2005 Express. [code]using System; using System.Windows.Forms; using MediaPortal.GUI.Library; namespace SomePlugin { /// <summary> /// Summary description for Class1. /// </summary> public class PluginClass : GUIWindow, ISetupForm { public PluginClass() { // // TODO: Add constructor logic here // } #region ISetupForm Members // Returns the name of the plugin which is shown in the plugin menu public string PluginName() { return "PluginClass"; } // Returns the description of the plugin is shown in the plugin menu public string Description() { return "Does stuff."; } // Returns the author of the plugin which is shown in the plugin menu public string Author() { return "me"; } // show the setup dialog public void ShowPlugin() { MessageBox.Show("Nothing to configure yet!"); } // Indicates whether plugin can be enabled/disabled public bool CanEnable() { return true; } // get ID of windowplugin belonging to this setup public int GetWindowId() { return 5678; } // Indicates if plugin is enabled by default; public bool DefaultEnabled() { return true; } // indicates if a plugin has its own setup screen public bool HasSetup() { return true; } /// <summary> /// If the plugin should have its own button on the main menu of Media Portal then it /// should return true to this method, otherwise if it should not be on home /// it should return false /// </summary> /// <param name="strButtonText">text the button should have</param> /// <param name="strButtonImage">image for the button, or empty for default</param> /// <param name="strButtonImageFocus">image for the button, or empty for default</param> /// <param name="strPictureImage">subpicture for the button or empty for none</param> /// <returns>true : plugin needs its own button on home /// false : plugin does not need its own button on home</returns> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { strButtonText=String.Empty; strButtonImage=String.Empty; strButtonImageFocus=String.Empty; strPictureImage=String.Empty; return false; } #endregion } }[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Plugin example doesnt show in list
Contact us
RSS
Top
Bottom