title: Converting from C# to VB.NET
body: <p><a href="http://wiki.team-mediaportal.com/MediaPortal1_Development/PluginDevelopersGuide#Appendix_A:_complete_source_code_of_the_plugin" rel="nofollow noreferrer">http://wiki.team-mediaportal.com/MediaPortal1_Development/PluginDevelopersGuide#Appendix_A:_complete_source_code_of_the_plugin</a></p>
  
  <p>Trying to translate the first "test"-code to VB.NET and it doesn't work. It compiles alright, but won't work as planned.</p>
  
  <p>I would guess it has something to do with the "Implements"-statement or something else related to how the class treats the interface. As a completely fresh .NET programmer I really would need your help figuring out why it doesn't work. Here's the converted and edited code below:</p>
  
  <pre><code>Imports System
  Imports System.Windows.Forms
  Imports MediaPortal.GUI.Library
  Imports MediaPortal.Dialogs
  
  Namespace OurPlugin
      Public Class Class1
  #Region "ISetupForm Members"
          Inherits GUIWindow
          Implements ISetupForm
  
          Public Sub New()
  
          End Sub
  
          ' Returns the name of the plugin which is shown in the plugin menu
          Public Function PluginName() As String Implements MediaPortal.GUI.Library.ISetupForm.PluginName
              Return "MyFirstPlugin"
          End Function
  
          ' Returns the description of the plugin is shown in the plugin menu
          Public Function Description() As String Implements MediaPortal.GUI.Library.ISetupForm.Description
              Return "My First Plugin"
          End Function
  
          ' Returns the author of the plugin which is shown in the plugin menu
          Public Function Author() As String Implements MediaPortal.GUI.Library.ISetupForm.Author
              Return "YourNameHere"
          End Function
  
          ' show the setup dialog
          Public Sub ShowPlugin() Implements MediaPortal.GUI.Library.ISetupForm.ShowPlugin
              MessageBox.Show("Nothing to configure, this is just an example")
          End Sub
  
          ' Indicates whether plugin can be enabled/disabled
          Public Function CanEnable() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.CanEnable
              Return True
          End Function
  
          ' Get Windows-ID
          Public Function GetWindowId() As Integer Implements MediaPortal.GUI.Library.ISetupForm.GetWindowId
              ' WindowID of windowplugin belonging to this setup
              ' enter your own unique code
              Return 5678
          End Function
  
          ' Indicates if plugin is enabled by default;
          Public Function DefaultEnabled() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.DefaultEnabled
              Return True
          End Function
  
          ' indicates if a plugin has it's own setup screen
          Public Function HasSetup() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.HasSetup
              Return True
          End Function
  
          ''' &lt;summary&gt;
          ''' 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
          ''' &lt;/summary&gt;
          ''' &lt;param name="strButtonText"&gt;text the button should have&lt;/param&gt;
          ''' &lt;param name="strButtonImage"&gt;image for the button, or empty for default&lt;/param&gt;
          ''' &lt;param name="strButtonImageFocus"&gt;image for the button, or empty for default&lt;/param&gt;
          ''' &lt;param name="strPictureImage"&gt;subpicture for the button or empty for none&lt;/param&gt;
          ''' &lt;returns&gt;true : plugin needs it's own button on home
          ''' false : plugin does not need it's own button on home&lt;/returns&gt;
  
          Public Function GetHome(ByRef strButtonText As String, ByRef strButtonImage As String, ByRef strButtonImageFocus As String, ByRef strPictureImage As String) As Boolean Implements MediaPortal.GUI.Library.ISetupForm.GetHome
              strButtonText = [String].Empty
              strButtonImage = [String].Empty
              strButtonImageFocus = [String].Empty
              strPictureImage = [String].Empty
              Return False
          End Function
  
          ' With GetID it will be an window-plugin / otherwise a process-plugin
          ' Enter the id number here again
          Public Overloads Overrides Property GetID() As Integer
              Get
                  Return 5678
              End Get
  
              Set(ByVal value As Integer)
              End Set
          End Property
  
  #End Region
  
      End Class
  End Namespace
  </code></pre>
  
  <p>[EDIT]</p>
  
  <p>Just to clarify. From the URL I pasted above I noticed I had an incorrect anchor. I'm not testing the complete sourcecode, but only the first "testcode" from this URL: <a href="http://wiki.team-mediaportal.com/MediaPortal1_Development/PluginDevelopersGuide#Implementing_GUIWindow_and_ISetupForm" rel="nofollow noreferrer">http://wiki.team-mediaportal.com/MediaPortal1_Development/PluginDevelopersGuide#Implementing_GUIWindow_and_ISetupForm</a></p>
  
  <p>The problem I am having is that it won't show up as a plugin in MediaPortal. The sample in C# works perfectly. Feels like I need to work this thing through before I move on to the GUI-part. I have no idea how to bugtest this since it needs to be loaded as a plugin in MediaPortal to see if it is working.</p>