events

C# Events between threads executed in their own thread (How to) ?

Hello, I'd like to have two Threads. Let's call them : Thread A Thread B Thread A fires an event and thread B listen to this event. When the Thread B Event Listener is executed, it's executed with the Thread A's thread ID, so i guess it is executed within the Thread A. What I'd like to do is be able to fire event to Thread B sayin...

JQuery input elements

I need to get all input elements within a div and then attach event handlers, so that whenever values change it updates a hidden field. Children elements within the div might already contain event handlers, if so the attach should chain it. Any help is much appreciated. ...

Java Simple ActionListener Questions

I have a main class in a program that launches another class that handles all the GUI stuff. In the GUI, i have a button that i need to attach an ActionListener to. The only problem is, the code to be executed needs to reside within the main class. How can i get the ActionPerformed() method to execute in the main class when a button is...

How to know the target element that raised the event in the ajax response callback?

I am posting to the server using jquery ajax using $.post. After server returns the response, I process the response in the callback function. In this callback function, how can I know which element was clicked on. Please check the following. In the function handleServerResponse, I would like to know the DOM element that raised this eve...

ASP.Net event only being raised every other time?

I have an ASP.Net web user control which represents a single entry in a list. To allow users to reorder the items, each item has buttons to move the item up or down the list. Clicking on one of these raises an event to the parent page, which then shuffles the items in the placeholder control. Code fragments from the list entry: Public ...

Why can I not update settings on datepicker using change in jQuery?

I am trying to create two different sets of settings for datepicker(http://keith-wood.name/datepick.html) when the user picks different radiobuttons in a group. Here's my code: $("input[name='shipping_time_english']").change(function(){ datepicker(); }); function datepicker() { ...

How can I tell if waiting on Event has timed out?

Hello. >>> import threading >>> event = threading.Event() >>> event.set() >>> print event.wait(1) None >>> event.clear() >>> print event.wait(1) None So it basically returns None both when condition was True and False. How can I distinguish the case of timeouting from the one with no waiting at all? Meanwile, the docs say This met...

Question about asp.net event handling

what is the difference between <asp:DropDownList ID="Combo" OnSelectedIndexChanged="Change" AutoPostBack="True" runat="server"/> and <asp:DropDownList ID="Combo" SelectedIndexChanged="Change" AutoPostBack="True" runat="server"/> ? And is the attribute AutoPostBack="True" always required? Iam asking because it seems my OnSelected...

How can I pass information with a WebClient request to identify the object that gets loaded?

I have a collection of custom objects called DataItems which contain URIs of images that I want to load and put in a collection for my Silverlight application to use. As I process each DataItem, I get its SourceUri (e.g. "http://..../picture001.png") and start it loading: void LoadNext() { WebClient webClientImgDownloader = new Web...

A Simple State Machine using a Static class in C# to notify other subscribers via Events

I've been trying to write a simple Static-class State Machine for my application to notify other controls and code when the system state changes. And I think I almost have it, but I'm running into a small issue that I'm not sure how to work around. Here's the code: // An enum denoting the 3 States public enum Status { Error = -1, Work...

jQuery event.which not working in IE

Hey Everyone, I am trying to get the code of an event using the event.which jQuery function. It is working great in FF, but in IE8 I am only getting "undefined". Is there some reason this would not work in IE8? I am using jQuery version 1.3.2 and the code is bellow (simplified). function handleInput(event) { //Get the character code...

Programmatically hook up events to methods?

Is there a way to hookup a button click to a method programmatically? It would be like imitating the CTRL+CLICK in Interface Builder. ...

How do I not allow typing in a text input field using jQuery?

I am using the jQuery datepicker on a text input field and I don't want to let the user change any of the text in the text input box with the keyboard. Here's my code: $('#rush_needed_by_english').keydown(function() { //code to not allow any changes to be made to input field }); How do I not allow keyboard typing in a text input fi...

How do you make jQuery bind events to elements loaded via Ajax?

I'm using the .load() function to load a section of html that has some jQuery functionality that is bound to a certain class. =/ thoughts? ...

How distinguish refresh and close event using jQuery ?

Possible Duplicate: Is there a way in javascript to detect if the unload event is caused via a refresh, the back button, or closing the browser? Hi all I have the below set of code $(window).unload( function() { test(); }); the test() will call when i close the window and also if i refresh the window ..... How can ide...

New closure on scriptblock

Consider this code: PS> $timer = New-Object Timers.Timer PS> $timer.Interval = 1000 PS> $i = 1; PS> Register-ObjectEvent $timer Elapsed -Action { write-host 'i: ' $i }.GetNewClosure() PS> $timer.Enabled = 1 i: 1 i: 1 i: 1 ... # wait a couple of seconds and change $i PS> $i = 2 i: 2 i: 2 i: 2 I assumed that when I create new clo...

iPhone: UITableViewCell drop event

hi all whether there are any event from which I handle the drop event of UITableViewCell. Basically I want to do some task when I drop some thing on a cell of UITableView. So i want to know that whether any event is exist for this purpose? ...

Preventing GUI update event floods in .NET

I'm creating a system that takes readings from a hardware device that sends data via a serial port. Every time a "packet" comes in off the serial port, I update and redraw some GUI components to reflect the updated information. Since serial port events stem from a separate thread, I have to call Invoke(Invalidate) on several components t...

How to TDD Asynchronous Events?

The fundamental question is how do I create a unit test that needs to call a method, wait for an event to happen on the tested class and then call another method (the one that we actually want to test)? Here's the scenario if you have time to read further: I'm developing an application that has to control a piece of hardware. In order ...

Raising WPF MouseLeftButtonDownEvent event

Hi, I am trying ot raise a MouseLeftButtonDownEvent by bubbling it up the Visual tree with the following code. MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice,0, MouseButton.Left); args.RoutedEvent = UIElement.MouseLeftButtonDownEvent; args.Source = this; RaiseE...