test new plugin (1 Viewer)

nadavbil

Portal Member
February 6, 2011
5
0
Hello All.
I an trying to write my first plugin for media portal.
I followed the instructions how to create one and after copying the basic code from the web, the instruction says that in order to test the code, I need to copy the plugin dll file to the plugins/windows directory.
I did, but I can't see my plugin in the mediaPortal configuration - plugins.

I am using MP 1.2.

I'm attaching the dll.

What am I doing wrong?

Thanks Nadav.
 

Attachments

  • MyFirstMPPlugin.zip
    2.4 KB

mbuzina

Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    You should attach the source, from dll we can not (easily) find out what is wrong. Did you implement the interface, set your own window I'd and your own plugin name? Did you specify compatability?
     

    nadavbil

    Portal Member
    February 6, 2011
    5
    0
    Thanks for the help.
    I'm attaching the code.

    Nadav.



    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using MediaPortal.GUI.Library;
    using MediaPortal.Dialogs;

    namespace MyFirstMPPlugin
    {
    public class Class1 : GUIWindow, ISetupForm
    {

    #region ISetupForm Members

    // Returns the name of the plugin which is shown in the plugin menu
    public string PluginName()
    {
    return "MyFirstPlugin";
    }

    // Returns the description of the plugin is shown in the plugin menu
    public string Description()
    {
    return "My First Plugin";
    }

    // Returns the author of the plugin which is shown in the plugin menu
    public string Author()
    {
    return "YourNameHere";
    }

    // show the setup dialog
    public void ShowPlugin()
    {
    MessageBox.Show("Nothing to configure, this is just an example");
    }

    // Indicates whether plugin can be enabled/disabled
    public bool CanEnable()
    {
    return true;
    }

    // Get Windows-ID
    public int GetWindowId()
    {
    // WindowID of windowplugin belonging to this setup
    // enter your own unique code
    return 5678;
    }

    // Indicates if plugin is enabled by default;
    public bool DefaultEnabled()
    {
    return true;
    }

    // indicates if a plugin has it's own setup screen
    public bool HasSetup()
    {
    return true;
    }

    /// <summary>
    /// If the plugin should have it's own button on the main menu of MediaPortal 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 it's own button on home
    /// false : plugin does not need it's 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;
    }

    // With GetID it will be an window-plugin / otherwise a process-plugin
    // Enter the id number here again
    public override int GetID
    {
    get
    {
    return 5678;
    }

    set
    {
    }
    }

    #endregion
    }
    }
     

    nadavbil

    Portal Member
    February 6, 2011
    5
    0
    OK,
    I got some help and be able to compile it in such way so I'm able to view it in the plugins.

    BUT I got another problem: it's incompatible to 1.2.1.

    I took all the dll's from 1.2.1 as I started the project after upgrading to it.

    How to make it compatible?

    Thanks Nadav.
     

    Users who are viewing this thread

    Top Bottom