A
Anonymous
Guest
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 http://mediaportal.sourceforge.net/PluginTutorial/PluginTutorial.htm which compiled fine, but it doesnt show up at the plugin list :\
Edit: The log says: Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.
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.
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 http://mediaportal.sourceforge.net/PluginTutorial/PluginTutorial.htm which compiled fine, but it doesnt show up at the plugin list :\
Edit: The log says: Exception in plugin loading :The format of the file 'SomePlugin.dll' is invalid.
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
}
}