events

Access events added with attachEvent() / addEventListener() in JavaScript

How can I access events added with attachEvent() / addEventListener() in JavaScript? Use case: debug events using FireBug's console. ...

How do I get objects in the responder chain to handle `insertText:` messages?

I have an NSView subclass which implements acceptsFirstResponder, resignFirstResponder and becomeFirstResponder. It also implements the following method: -(void)keyDown:(NSEvent *) event { [self interpretKeyEvents:[NSArray arrayWithObject:event]]; } I handle the messages that interpertKeyEvent: sends in an appController class (Th...

Creating a cancel scheme

I have a program that will analyzes source code. It can recursively go through a directory to find all projects, and then recursively go through the project to find all source code. I want to create a cancel process button, which allows the user to stop the code parsing. I run the code parsing in a background worker. I want to be a...

Is it possible to bind an Event in a Silverlight DataTemplate?

Is it possible to bind an Event in a Silverlight DataTemplate? If so, what is the best way to do it? For example, say you've created a DataTemplate that has a Button in it, like this: <UserControl.Resources> <DataTemplate x:Key="MyDataTemplate" > <Grid> <Button Content="{Binding ButtonText}" Margin="4" /> </Grid> ...

How to receive event when network is connected and also when user logs in

I have a service that runs and I'd like to receive notification when: a) the network is connected. b) when a user logs in to the machine. How can I do this? (C# .NET 2.0) ...

Weird Event Listening in ActionScript3

I have a weird quirk in ActionScript. I need to pass the index to a callback function. Here is my code for (var i:Number = 0; ((i < arrayQueue.length) && uploading); i++) { var lid:ListItemData=ListItemData(arrayQueue[i]); var localI:Number= new Number(i); // to copy? var errorCallback:Function = function():void { OnUpload...

Application_Start not being hit in ASP.NET web app

I'm trying to debug something in the global.asax.cs file in an ASP.NET web app and have set a breakpoint in the Application_Start() event however that event is not getting fired when I start the web app inside VS2008. I'm targeting the 3.5 framework. What could prevent this event from being fired? Or how could I have messed up the proje...

Detect in python which keys are pressed

I need to know which key is being pressed right now. I'm not looking to capture some specific keys to trigger an event or anything like that, I want to know which keys are pressed now and display a list of them. I also need to capture special keys like F1 ... F12, shift, alt, home, windows, etc. Basically all keys on the keyboard. Ho...

WPF/C# Calling Event after Command Executes

Hello, I am looking for a way to be able to have an event run after a command executes. I am working with EditingCommands (ToggleBold, ToggleItalic...ect.) and would like to be able to have a method called directly after the command finishes whatever it is doing. An example would be that I have some text selected and press Ctrl+B and tha...

Dynamically loaded control - how can I access a value in Page_Init

I am loading a LinkButton dynamically when a user clicks on another LinkButton. I am attaching an event handler to it. When the user clicks on the dynamically loaded LinkButton, the event does not fire. From what I've been reading, I understand this is because when the page posts back the dynamically loaded control no longer exists....

onblur ajax not calling the callback function

I Have the following code which is called inline as below also. The problem is the alert never fires. In firebug i can see that data is filled with my object, but still the alert doesn't fire. Any ideas? function update(s_arrive) { $.post("../base/getDestInfo.asp", { "dest": s_arrive }, function(data) { alert('aa'); }, "json"); } <...

WPF: Referencing the Window from a Custom Control

I have followed the Accepted Answer's instructions from this post as regards creating a code behind file for a Resource Dictionary, and it worked...so now I can attach events to controls in the generic.xml file. But now I want to be able to call the DragMove() method from an event in there and since there aren't any references to the wi...

Javascript Event Hierarchy in Prototype framework

Hi there, is there any event to be handled between the dom:loaded and load using Prototype javascript framework? I've implemented a preloader using prototype which is looking like this: Event.observe(window,"load",preload); function preload(){ if($('wrapper')) $('wrapper').setStyle({"display":"block"}); if($('loading')) ...

Is there anything you can do with a C# event that you cannot do with a VB Event?

My friend is primarily a VB developer and he says time and time again how much more simple it is to code events in VB than C#. My take on the issue is that it probably is easier but if there was not a reason for the added complexity, they probably would have made it just as simple in C#. Can anyone tell me if there is any added flexibili...

Why don't PreSendRequestHeaders and PreSendRequestContent run consistently?

When working with HTTP modules, has anyone noticed that the final two events in the pipeline -- PreSendRequestHeaders and PreSendRequestContent -- don't always run? I've verified that code bound to EndRequest will run, but will not when bound to either PreSendRequestHeaders or PreSendRequestContent. Is there a reason why? I thought pe...

Watch control to determine events being fired?

Is there a way to list all fired events for specific WinForms controls without explicitly creating a handler for each possible event? For example, I might want to see the sequence of events that fire between a DataGridView and the BindingSource during various databinding actions. ...

JQuery event selector

Say i have 10 small images that i want to use as tooltips. Im assinging them all the same class, '.helper' Im selecting helper, then calling mouseenter(function() { $(".helper").stop(false,true).fadeIn(); }) I then want a div to popup, containing some text. This works fine if there's only one tooltip on the page, but as soon as ther...

Can/should I use a mocking framework to dynamically add events to a class?

Consider the following interface: public interface IMyCallback { void SomeEvent(int someArg); } which is the contract for a WCF callback that will be receiving "events" from a WCF service. My implementation for this interface looks like this public class MyCallback : IMyCallback { void IMyCallback.SomeEvent(int someArg) { O...

Simulating a tab keypress using JavaScript

I'd like to have the browser act as if the user had pressed the Tab key when they click on something. In the click handler I've tried the following approaches: var event = document.createEvent('KeyboardEvent'); event.initKeyEvent("keypress", true, true, null, false, false, false, false, 9, 0); this.input.focus()[0].dispatchEvent(event)...

Will an empty delegate eat up memory?

public sealed class FtpManager { public event EventHandler LoggingIn = delegate { }; private void OnLoggingIn(object sender, EventArgs e) { var handler = LoggingIn; handler(sender, e); } // ... } In the above code, I have initialized LoggingIn event handler with an empty delegate. Will that affect memory...