events

Overhead due to use of Events

I have a custom thread pool class, that creates some threads that each wait on their own event (signal). When a new job is added to the thread pool, it wakes the first free thread so that it executes the job. The problem is the following : I have around 1000 loops of each around 10'000 iterations do to. These loops must be executed sequ...

Unloading/Removing content from an iFrame

Is there anyway to unload a page that has been loaded inside of an iframe? I do not want to have to change the iframe src to a blank page if possible. I am basically looking for something that will do something like this $('#frameID').attr("src",""); except that code does not seem to clear the previously loaded page. Is there a "unload"...

Removing event handlers

Is this: Button.Click -= new EventHandler(Button_Click); the same as this: Button.Click -= Button_Click; I ask because to me it seems that the former is removing a new reference to a method, and the latter one is removing a method itself. But then again, maybe the new EventHandler part is implicit in the += or -= overload in case t...

JavaScript: DOM load events, execution sequence, and $(document).ready()

I just realized that I lack the fundamental knowledge of what exactly happens as a page is being loaded into a browser. Assume I have a structure like this: <head> <script src="jquery.js" type="text/javascript"></script> <script src="first.js" type="text/javascript"></script> </head> <body> ... <script type="text/javascript" id="midd...

Handling events in wxPython

How to pass an argument to an event handler in wxPython? Here's my code: def close_handler(event): baz(foo) ... foo = 'bar' frame.Bind(wx.EVT_CLOSE, close_handler) How to pass foo to close_handler() function? ...

iPhone dev - delegates, notifications, unsubscribe before deallocated?

In my question about using a delegate or a UIControl Event, this was in Kendall Helmstetter Geln's answer: Both are about an equal load to work with - with a delegate you have to set yourself and then remember to unset yourself before you are deallocated. You have to do the same thing with notifications, remember to start listening a...

jQuery hover(): mouseout does not fire when using overflow:auto (with scrollbars)

I'm using jQuery's hover() helper to attach some behavior to <li> elements in a <ul> with max-height and overflow:auto CSS properties. When the height of the <ul> goes beyond max-height and the vertical scrollbar appears, hovering over the <li> elements triggers mouseOver, but if I move to the right to the scrollbar and start scrolling...

Javascript event handling and flow control

I'm attempting to build a webpage that loads depending on the input provided. I'm having some trouble wrapping my head around event handling in javascript, basically. Coming from python, if I wanted to wait for a specific keyboard input before moving on to the next object to display, I would create a while loop and put a key listener ins...

What is the "proper" way in WPF MVVM to bind a frameworkElement event to a viewmodel handler?

So here is my dilemma, I want to handle view events on my view model, trouble is, in order to add an event handler, my view has to have a code behind file and therefore a class attribute has to be set. I'm 99% sure this is a bad idea, and to be perfectly honest, i'm not even sure how to do it (other than the obvious x:Class="" part) Wh...

Using the Exited event in vb.net

Ok, I'm making a very basic vb.net winforms app, essentially you can drag files into it, and it then uses a batch file to process the files. It's pretty simple and everything is going to plan so far, it accepts the right files, it uses the batch file to process them and the batch file does what it is supposed to. The only problem is th...

In WPF MVVM, how to spawn a background task that runs a callback on the UI Thread?

I'm familiar with the control's dispatcher object but that doesn't solve my issue in an MVVM scenario. I've got a UI command, that calls a method on my VM, that spawns a thread and then returns, when the thread is done (background worker might be good for this?) it will raise a callback, but the trick is, that callback modifies an obser...

JQuery same click event for multiple elements

Hello, is there any way to execute same code for different elements on the page? $('.class1').click(function() { some_function(); }); $('.class2').click(function() { some_function(); }); instead to do something like: $('.class1').$('.class2').click(function() { some_function(); }); Thanks ...

Events pile up during CashDrawer.WaitForDrawerClose

I'm writing an application for a POS and using POS for .NET. I've found that when I call the WaitForDrawerClose method, while the application will sit and wait unresponsively until the drawer is closed (as desired), any clicks elsewhere seem to pile up in the queue and all fire once the drawer has been closed. How can I make my app stop ...

Display a success message to user in a SharePoint Document Library after validation in ItemAdding Event

When validating a document in the ItemAdding event there are many ways to display errors to the user, but there doesn't seem to be a way to display successes to user, like a validation was successful. An info message to the user at the top of document library would be great. public class MyItemEventReceiver : SPItemEventReceiver { p...

ColdFusion Event Gateways in Clusters

When clustering instances of Coldfusion, how do the event gateways respond? Do the requests also get distributed among the clutster? Or is it per instance? Thanks, Faisal Abid ...

Get Windows Server shutdown reason in C#

Hi, is it possible to get shutdown reason in Windows Server 2008 immediately after user choose the reason in dialog window? For the shutdown event i'm using SystemEvents.SessionEnding.. I want to write windows service, which will send e-mail about this event. Or is there any other way in windows server to send e-mails about shutdown/re...

C# - Win Forms - Event flow Cycle

I was reading Jon Skeet's refcard on C#. He stated: "Events are closely related to delegates but they are not the same thing." So from my understanding, when events are raised, handlers (delegates) execute the code. I have the following doubts: (1) When we declare an event , will it be registered in any "REGISTERS?" or "System Re...

jQuery event processing and the ready function

Hi, I am very new to jQuery (I started this morning) and I am confused about exactly what triggers the function supplied to the ready function, to be executed. According to the jQuery documentation [http://docs.jquery.com/Events/ready#fn%5D the ready function Binds a function to be executed whenever the DOM is ready to be trave...

Notify minimised window of an event occurrence in an applet

Hi, I have a JApplet which is used for chat. I would like to make it possible that when the applet is minimised and a chat message is received by the user, the minimised window becomes orange (and thus shows the user that something has occurred). How is it possible to make the applet do this? Thanks, Tim ...

Should an Event that has no arguments define its own custom EventArgs or simply use System.EventArgs instead?

I have an event that is currently defined with no event arguments. That is, the EventArgs it sends is EventArgs.Empty. In this case, it is simplest to declare my Event handler as: EventHandler<System.EventArgs> MyCustomEvent; I do not plan on adding any event arguments to this event, but it is possible that any code could need to cha...