events

Very odd bug when using a System.Timers.Timer

For some odd reason the Elapsed event is firing twice, where it should definitely be firing once. And immediately after, the timer ceases to work... The code structure is somewhat like this: A certain object is defined to fire a certain event when a value it contains, which is constantly updated in 500-1500ms intervals, increases in over...

Java events

How does the event creation and handling work in Java? ...

How to hook a global PASTE EVENT?

I am developing a software that needs to know when the PASTE EVENT (through the context menu or ctrl+V) happens (only for files / directories). More or less, something like it happens with TeraCopy or Copy Handler. When you copy and then paste, it is TeraCopy thats handles the pastings. I know more or less how to capture the COPY EVENT, ...

FLEX3, Click and event catching, special case

Here is my problem: I have a main canvas 'blackboard' in a panel, this canvas has itself several childs, like a toolbar (tiles), a label and some skinning. The problem is that when i move to the rectangle tool and i start drawing rectangles if i want to change the tool when i click on an other tool such as 'circle' or 'select' the but...

Can I find out which control events will fire on an ASP postback?

Is it possible to get a list of control events that are going to fire before they happen, say inside the Page_Load handler? For example if a button was clicked can I figure this out before the button_click event handler is called? ...

When will my BackgroundWorker instance be garbage collected

consider this code block public void ManageInstalledComponentsUpdate() { IUpdateView view = new UpdaterForm(); BackgroundWorker worker = new BackgroundWorker(); Update update = new Update(); worker.WorkerReportsProgress = true; worker.WorkerSupportsCancellation = true; ...

What is the equivalent of .NET events in Ruby?

The problem is very simple. An object needs to notify some events that might be of interest to observers. When I sat to validate a design that I cooked up now in Ruby just to validate it.. I find myself stumped as to how to implement the object events. In .Net this would be a one-liner.. .Net also does handler method signature verificat...

Programmatically add custom event in the iPhone Calendar

Is there any way to add iCal event to the iPhone Calendar from the custom App? ...

Event signature pattern in .net

What's the point in the standard pattern for event delegates in .net? I.e. the EventHandler predefined delegate? Why not just choose the most appropriate signature for the requirement? Edit: And furthermore, is it necessary to slavishly follow Microsoft's example in all cases? ...

Handling a Click for all controls on a Form

I have a .NET UserControl (FFX 3.5). This control contains several child Controls - a Panel, a couple Labels, a couple TextBoxes, and yet another custom Control. I want to handle a right click anywhere on the base Control - so a right click on any child control (or child of a child in the case of the Panel). I'd like to do it so that ...

Unit testing that an event is raised in C#

I have some code that raises PropertyChangedEvents events and I would like to be able to unit test that the events are being raised correctly. The code that is raising the events is like public class MyClass : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected void No...

VB.NET: Are events raised even if there are no event handlers?

I have a class that downloads, examines and saves some large XML files. Sometimes I want the UI to tell me what's going on, but sometimes I will use the class and ignore the events. So I have placed lines of code like this in a dozen places: RaiseEvent Report("Sending request: " & queryString) RaiseEvent Report("Saving file: " & fileNa...

JQuery-bound event handlers

Hi, I want to attach a 'click' event handler to the first child of an element with ID 'foo' using JQuery. I understand that the syntax for doing this is: $('#foo:first-child').bind('click', function(event) { // I want to access the first child here }) Within the handler body I want to access the element which caused the event to b...

Why events can't be used in the same way in derived classes as in the base class in C#?

In following code, I want to extend the behaviour of a class by deriving/subclassing it, and make use of an event of the base class: public class A { public event EventHandler SomeEvent; public void someMethod() { if(SomeEvent != null) SomeEvent(this, someArgs); } } public class B : A { public void someOthe...

Events/Interrupts in Serial Communication

I want to read and write from serial using events/interrupts. Currently, I have it in a while loop and it continuously reads and writes through the serial. I want it to only read when something comes from the serial port. How do I implement this in C++? This is my current code: while(true) { //read if(!ReadFi...

Spring & Hibernate EJB Events

Is it possible to define a spring-managed EJB3 hibernate listener? I have this definition in my persistence.xml: <properties> <property name="hibernate.ejb.interceptor" value="my.class.HibernateAuditInterceptor" /> <property name="hibernate.ejb.event.post-update" value="my.class.HibernateAuditTrailEventListene...

Why won't this event listener work?

$('input[type=checkbox]').unbind().click(function(e){ $(this).attr('checked', true) return false; }); I NEED to return false because I have an event on its parent and I don't want to trigger that. It just WON'T check that checkbox :| Already it drive me insane. I think I used this before on another project and I had no problems ...

searching VB6 code

I've inherited a ASP/VB6 code base (not my forte... yet) and I'm trying tease it apart to figure out the cause on an error message I'm receiving when running the app. I've traced it back through an event that is being raised in on of my classes. Is there away in windows I can search the bulk of the code base for where it is being consum...

How can I control the order in which event handlers are fired?

Are event handlers fired in the order that they attached to the event? If not, can I enforce some kind of order onto the event handlers such that they are called in a specific order? ...

Is SetEvent atomic?

Is it safe to have 2 or more threads call the Win32 API's SetEvent on the same event handler not being protected by a critical section? ...