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
noob question - writing a plugin in VB
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="ghackett" data-source="post: 26573" data-attributes="member: 12735"><p>Hi guys, I know that C# is the preferred language for mediaportal, but I am, by trade, an ASP.NET Webb App programmer, and I work completely in VB. I'm trying to write my first plugin in VB mainly because I already have a bunch of code I want to use in it and I dont want to have to port it all over to C#. Anyway, I'm going over your "My First Plugin tutorial and encountering a problem. Can anyone with some VB experience help me out? I think that once I get past this hump, I can finish the rest on my own.</p><p></p><p>I ported the beginning of the OurPlugin code over to VB, but I'm having probles impletemnting some of the (all of the) functions without the override tag. VS is telling me that I need to implement the Overrideable functions Description(), Author(), etc... in order to implement ISetupForm, but I have implemented those classes. When I add the Overrides tag to any of those classes though, I get an error saying that there is no class to override.</p><p></p><p>here is my code (it currently does nothing)</p><p>[code]</p><p>Imports System</p><p>Imports System.Windows.Forms</p><p>Imports MediaPortal.GUI.Library</p><p></p><p>Namespace MyRandomVideo</p><p></p><p> Public Class RandomVideo</p><p> Inherits GUIWindow</p><p> Implements ISetupForm</p><p></p><p> Public Sub New()</p><p></p><p> End Sub</p><p></p><p>#Region "ISetupForm Members"</p><p></p><p> Public Function PluginName() As String</p><p> Return "My Random Video"</p><p> End Function</p><p></p><p> Public Function Description() As String</p><p> Return "Play Random Videos From Selected Folders"</p><p> End Function</p><p></p><p> Public Function Author() As String</p><p> Return "GHackett"</p><p> End Function</p><p></p><p> Public Sub ShowPlugin()</p><p> MessageBox.Show(Application.StartupPath)</p><p> End Sub</p><p></p><p> Public Function CanEnable() As Boolean</p><p> Return True</p><p> End Function</p><p></p><p> Public Function GetWindowId() As Integer</p><p> Return 5678</p><p> End Function</p><p></p><p> Public Function DefaultEnabled() As Boolean</p><p> Return True</p><p> End Function</p><p></p><p> Public Function HasSetup() As Boolean</p><p> Return True</p><p> End Function</p><p></p><p> Public Function GetHome(ByRef strButtonText As String, ByRef strButtonImage As String, ByRef strButtonImageFocus As String, ByRef strPictureImage As String) As Boolean</p><p> strButtonText = PluginName()</p><p> strButtonImage = String.Empty</p><p> strButtonImageFocus = String.Empty</p><p> strPictureImage = String.Empty</p><p> Return True</p><p> End Function</p><p></p><p> Public Overrides Property GetID() As Integer</p><p> Get</p><p> Return 5678</p><p> End Get</p><p> Set(ByVal Value As Integer)</p><p></p><p> End Set</p><p> End Property</p><p></p><p> Public Overrides Function Init() As Boolean</p><p> Return Load(GUIGraphicsContext.Skin + "\MyRandomVideo.xml")</p><p> End Function</p><p></p><p>#End Region</p><p></p><p></p><p> End Class</p><p>End Namespace</p><p>[/code]</p><p></p><p>VS 2003 puts a squggly blue line underneath ISetupForm at the top and gives me laundry list of errors when i try to compile telling me that I dont implement the proper functions. Any help would be appreciated.</p><p></p><p>P.S. I would use C# but VB is just so much easier to write. DAMN M$</p></blockquote><p></p>
[QUOTE="ghackett, post: 26573, member: 12735"] Hi guys, I know that C# is the preferred language for mediaportal, but I am, by trade, an ASP.NET Webb App programmer, and I work completely in VB. I'm trying to write my first plugin in VB mainly because I already have a bunch of code I want to use in it and I dont want to have to port it all over to C#. Anyway, I'm going over your "My First Plugin tutorial and encountering a problem. Can anyone with some VB experience help me out? I think that once I get past this hump, I can finish the rest on my own. I ported the beginning of the OurPlugin code over to VB, but I'm having probles impletemnting some of the (all of the) functions without the override tag. VS is telling me that I need to implement the Overrideable functions Description(), Author(), etc... in order to implement ISetupForm, but I have implemented those classes. When I add the Overrides tag to any of those classes though, I get an error saying that there is no class to override. here is my code (it currently does nothing) [code] Imports System Imports System.Windows.Forms Imports MediaPortal.GUI.Library Namespace MyRandomVideo Public Class RandomVideo Inherits GUIWindow Implements ISetupForm Public Sub New() End Sub #Region "ISetupForm Members" Public Function PluginName() As String Return "My Random Video" End Function Public Function Description() As String Return "Play Random Videos From Selected Folders" End Function Public Function Author() As String Return "GHackett" End Function Public Sub ShowPlugin() MessageBox.Show(Application.StartupPath) End Sub Public Function CanEnable() As Boolean Return True End Function Public Function GetWindowId() As Integer Return 5678 End Function Public Function DefaultEnabled() As Boolean Return True End Function Public Function HasSetup() As Boolean Return True End Function Public Function GetHome(ByRef strButtonText As String, ByRef strButtonImage As String, ByRef strButtonImageFocus As String, ByRef strPictureImage As String) As Boolean strButtonText = PluginName() strButtonImage = String.Empty strButtonImageFocus = String.Empty strPictureImage = String.Empty Return True End Function Public Overrides Property GetID() As Integer Get Return 5678 End Get Set(ByVal Value As Integer) End Set End Property Public Overrides Function Init() As Boolean Return Load(GUIGraphicsContext.Skin + "\MyRandomVideo.xml") End Function #End Region End Class End Namespace [/code] VS 2003 puts a squggly blue line underneath ISetupForm at the top and gives me laundry list of errors when i try to compile telling me that I dont implement the proper functions. Any help would be appreciated. P.S. I would use C# but VB is just so much easier to write. DAMN M$ [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
noob question - writing a plugin in VB
Contact us
RSS
Top
Bottom