איך ממירים?
the c# code: public delegate void SchedulerEventDelegate(SchedulerEventType type, string scheduleName); static public event SchedulerEventDelegate OnSchedulerEvent; if (OnSchedulerEvent != null) how can I convert this to VB? more detail: I have a code in c# from http://www.codeproject.com/csharp/eventscheduler.asp My boss ask me to convert it to vb.net currently I have a problem with this line: Code: if (OnSchedulerEvent != null) (in c#) when i convert it to visual basic code:--------------------------------------------------------------------------------If Not OnSchedulerEvent Is Nothing Then-------------------------------------------------------------------------------- the error I'll get: Public Shared Event OnSchedulerEvent(type As SchedulerEventType, StrScheduleName As String)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. what can I'll do???? C# code Code: public delegate void SchedulerEventDelegate(SchedulerEventType type, string scheduleName); static public event SchedulerEventDelegate OnSchedulerEvent; if (OnSchedulerEvent != null) Vb.net code visual basic code:--------------------------------------------------------------------------------Public Delegate Sub SchedulerEventDelegate(ByVal type As SchedulerEventType, ByVal StrScheduleName As String) Public Shared Event OnSchedulerEvent As SchedulerEventDelegate--------------------------------------------------------------------------------
the c# code: public delegate void SchedulerEventDelegate(SchedulerEventType type, string scheduleName); static public event SchedulerEventDelegate OnSchedulerEvent; if (OnSchedulerEvent != null) how can I convert this to VB? more detail: I have a code in c# from http://www.codeproject.com/csharp/eventscheduler.asp My boss ask me to convert it to vb.net currently I have a problem with this line: Code: if (OnSchedulerEvent != null) (in c#) when i convert it to visual basic code:--------------------------------------------------------------------------------If Not OnSchedulerEvent Is Nothing Then-------------------------------------------------------------------------------- the error I'll get: Public Shared Event OnSchedulerEvent(type As SchedulerEventType, StrScheduleName As String)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. what can I'll do???? C# code Code: public delegate void SchedulerEventDelegate(SchedulerEventType type, string scheduleName); static public event SchedulerEventDelegate OnSchedulerEvent; if (OnSchedulerEvent != null) Vb.net code visual basic code:--------------------------------------------------------------------------------Public Delegate Sub SchedulerEventDelegate(ByVal type As SchedulerEventType, ByVal StrScheduleName As String) Public Shared Event OnSchedulerEvent As SchedulerEventDelegate--------------------------------------------------------------------------------