Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. GetInvocationList() equivalent in vb

GetInvocationList() equivalent in vb

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zorifila
    wrote on last edited by
    #1

    Hi, How can i access the individual delegates attached to an Event? In C#, I can use the GetInvocationList() Method on a Delegate. How can i do this in vb.Net? Thanks, Zor

    C 1 Reply Last reply
    0
    • Z zorifila

      Hi, How can i access the individual delegates attached to an Event? In C#, I can use the GetInvocationList() Method on a Delegate. How can i do this in vb.Net? Thanks, Zor

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      According to MSDN[^], VB.NET offers this the same as C#. Christian Graus - Microsoft MVP - C++

      Z 1 Reply Last reply
      0
      • C Christian Graus

        According to MSDN[^], VB.NET offers this the same as C#. Christian Graus - Microsoft MVP - C++

        Z Offline
        Z Offline
        zorifila
        wrote on last edited by
        #3

        Thanks Graus... well, i did'nt explain it properly. I need to be able to access individual delegates attached to an Event. Lets look at a simple scenario...

        Class MyClass

        Public Delegate Sub MyDelegate(...)
        Public Event MyEvent As MyDelegate

        protected Sub OnMyEvent(...)

        'RaiseEvent MyEvent(...) ' I do not want to do it this way.
        
        ' I want to be able to loop through each delegate attached to the event.
        .
        .
        **MyEvent.GetInvocationList()** ' VB Compiler does not allow this.
        .
        .
        

        end Sub

        end class

        Thanks, Zor

        D 1 Reply Last reply
        0
        • Z zorifila

          Thanks Graus... well, i did'nt explain it properly. I need to be able to access individual delegates attached to an Event. Lets look at a simple scenario...

          Class MyClass

          Public Delegate Sub MyDelegate(...)
          Public Event MyEvent As MyDelegate

          protected Sub OnMyEvent(...)

          'RaiseEvent MyEvent(...) ' I do not want to do it this way.
          
          ' I want to be able to loop through each delegate attached to the event.
          .
          .
          **MyEvent.GetInvocationList()** ' VB Compiler does not allow this.
          .
          .
          

          end Sub

          end class

          Thanks, Zor

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Off the top of my head here, shouldn't that highlighted line you posted read:

          Dim callbackList() As MyDelegate
          callbackList = MyDelegate.GetInvocationList()

          ???? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          Z 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Off the top of my head here, shouldn't that highlighted line you posted read:

            Dim callbackList() As MyDelegate
            callbackList = MyDelegate.GetInvocationList()

            ???? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            Z Offline
            Z Offline
            zorifila
            wrote on last edited by
            #5

            Hi, "MyDelegate" is Just a Type. Not an instance. GetInvocationList() cannot be called on MyDelegate. Thanks, Zor

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups