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. .NET (Core and Framework)
  4. Quick Question - Events / Event Handleing

Quick Question - Events / Event Handleing

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncomdata-structureshelp
3 Posts 2 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.
  • J Offline
    J Offline
    Jawz X
    wrote on last edited by
    #1

    Quick question, Is it possible to either temporarily disable or even suppress an event from firing? The problem that I'm am having is when I'm manipulating properties (related to the event) the event is firing and I'm, eventually, receiveing a stack over flow exception...

    Frank V. http://www.TheOpenSourceU.com

    R 1 Reply Last reply
    0
    • J Jawz X

      Quick question, Is it possible to either temporarily disable or even suppress an event from firing? The problem that I'm am having is when I'm manipulating properties (related to the event) the event is firing and I'm, eventually, receiveing a stack over flow exception...

      Frank V. http://www.TheOpenSourceU.com

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      One simple approach is to put a local boolean viariable in the event handler, defaulted to false. before processing the event, check the flag, if it is fallse, set it to true and do the event processing the set it back to false. if it is true at the start, just return.

      J 1 Reply Last reply
      0
      • R Rob Graham

        One simple approach is to put a local boolean viariable in the event handler, defaulted to false. before processing the event, check the flag, if it is fallse, set it to true and do the event processing the set it back to false. if it is true at the start, just return.

        J Offline
        J Offline
        Jawz X
        wrote on last edited by
        #3

        Rob, Thank you for you reply. I appreciate it. This is what I ended up doing right after posting this. I'm sorry, I should have mentioned it. I was hoping for a more elegant solution. But this works, so I will continue to use this. Again, Thank You.

        Regards, Frank V. http://www.TheOpenSourceU.com

        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