IceChat Forums

IceChat 9 => IceChat 9 Problems => Topic started by: Askerion on October 28, 2014, 05:10:06 AM

Title: Plugin in Vb.net
Post by: Askerion on October 28, 2014, 05:10:06 AM

Hello, it is possible to program a plugin in vb.net?
Title: Re: Plugin in Vb.net
Post by: Askerion on October 28, 2014, 06:34:52 AM
This is my code

Code: [Select]

'*****************************************************************************\
' * IceChat 9 Internet Relay Chat Client
' *
' * Copyright (C) 2011 Paul Vanderzee <snerf@icechat.net>
' *                                    <www.icechat.net>
' * This program is free software; you can redistribute it and/or modify
' * it under the terms of the GNU General Public License as published by
' * the Free Software Foundation; either version 2, or (at your option)
' * any later version.
' *
' * This program is distributed in the hope that it will be useful,
' * but WITHOUT ANY WARRANTY; without even the implied warranty of
' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' * GNU General Public License for more details.
' *
' * You should have received a copy of the GNU General Public License
' * along with this program; if not, write to the Free Software
' * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
' *
' * Please consult the LICENSE.txt file included with this project for
' * more details
' *
'\*****************************************************************************
Imports System.Windows.Forms
Imports System.Xml.Serialization
Imports System.Collections
Imports System.IO
Imports System.Text.RegularExpressions

Namespace IceChatPlugin


    Public Class Plugin
        Inherits IPluginIceChat





        'all the events get declared here, do not change
        Public Overrides Event OnCommand As OutGoingCommandHandler

        Private m_Name As String
        Private m_Author As String
        Private m_Version As String

        Public Overrides ReadOnly Property Name() As String
            Get
                Return m_Name
            End Get
        End Property
        Public Overrides ReadOnly Property Version() As String
            Get
                Return m_Version
            End Get
        End Property
        Public Overrides ReadOnly Property Author() As String
            Get
                Return m_Author
            End Get
        End Property




        Public Sub New()
            'set your default values here
            m_Name = "Default Plugin"
            m_Author = "Default Author"
            m_Version = "1.0"
        End Sub

        'declare the standard methods

        Public Overrides Sub Dispose()

        End Sub

        Public Overrides Sub Initialize()

        End Sub

        'if you want to add a new method to override, use public override
    End Class

End Namespace


but this line give me an error
Public Overrides Event OnCommand As OutGoingCommandHandler

Can anyone help me, please
Title: Re: Plugin in Vb.net
Post by: Snerf on October 28, 2014, 12:24:21 PM
You can ignore the error.
Title: Re: Plugin in Vb.net
Post by: Askerion on October 28, 2014, 11:43:45 PM
I can not compile the DLL, because of this error

Error 2 "override" is not valid in an event declaration
Title: Re: Plugin in Vb.net
Post by: Snerf on October 30, 2014, 12:18:31 PM
Just remove that line , comment it out.
It works fine in C#
Title: Re: Plugin in Vb.net
Post by: Askerion on November 02, 2014, 12:12:15 AM
Yes, I had to remove the namespace. Now it works very well

Regards