event-handling

Can using lambdas as event handlers cause a memory leak?

Say we have the following method: private MyObject foo = new MyObject(); // and later in the class public void PotentialMemoryLeaker(){ int firedCount = 0; foo.AnEvent += (o,e) => { firedCount++;Console.Write(firedCount);}; foo.MethodThatFiresAnEvent(); } If the class with this method is instantiated and the PotentialMemoryLea...

Distributed event handling mechanism for Java

I'm looking for a reasonably fast event handling mechanism in Java to generate and handle events across different JVMs running on different hosts. For event handling across multiple threads in a single JVM, I found some good candidates like Jetlang. But in my search for a distributed equivalent , I couldn't find anything that was lightw...

C# event handling (compared to Java)

Hello everyone: I am currently having a hardtime understanding and implementing events in C# using delagates. I am used to the Java way of doing things: Define an interface for a listener type which would contain a number of method definitions Define adapter class for that interface to make things easier if I'm not interested in all ...

How to raise an event from a SWF in a SWFLoader to a parent Flex application?

How can I raise an event from a SWF file loaded into a Flex application (using SWFLoader)? I want to be able to detect a) when a button is pressed b) when the animation ends ...

How do I raise an event via reflection in .NET (c#)?

I have a third-party editor that basically comprises a textbox and a button (the DevExpress ButtonEdit control). I want to make a particular keystroke (Alt-Down) emulate clicking the button. In order to avoid writing this over and over, I want to make a generic KeyUp event handler that will raise the ButtonClick event. Unfortunately, ...

Asp.net server control same event handling order on server-side/client-side

I have an asp.net server control (with the asp: in its definition). The button has been set to do post back. On the server side, I have the on click event handler e.g btnSave_click() On the client side, I have a javascript function to be invoked on the click event e.g btnSave.Attributes.Add("onclick","javascript: return CheckIsDirty();...

Can an Actionscript component listen to its own propertyChange events?

I have a CircleButton class in Actionscript. I want to know when someone externally has changed the 'on' property. I try listening to 'onChange' but it never hits that event handler. I know I can write the 'on' property as a get/setter but I like the simplicity of just using [Bindable] Can an object not listen to its own events? publi...

C# custom event handlers

If I have a property: public list<String> names { get; set; } How can I generate and handle a custom Event for arguments sake called 'onNamesChanged' whenever a name gets added to the list? ...

how can I write a generic property modification function in Flex/Actionscript3?

I'm new to Flex, although not new to programming. I want to write a generic event handler that will be called by all my textinput boxes when they receive focus. When they have focus, I want to change the colour of the textinput box. When they lose focus, I want to restore the "inactive" color profile. I could write an ActionScript even...

Event handling in embedded code

Hi all, I want to know how events are used in embedded system code. Main intention is to know how exactly event flags are set/reset in code. and how to identify which task is using which event flag and which bits of the flag are getting set/reset by each task. Please put your suggestion or comments about it. Thanks in advance. (ed...

Question about an event perculiarity in a TabControl.

I have a little demonstration below of a peculiar problem. using System; using System.Windows.Forms; namespace WindowsApplication1 { public class TestForm : Form { private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; ...

Raising C# events with an extension method - is it bad?

We're all familiar with the horror that is C# event declaration. To ensure thread-safety, the standard is to write something like this: public event EventHandler SomethingHappened; protected virtual void OnSomethingHappened(EventArgs e) { var handler = SomethingHappened; if (handler != null) handler(this, e)...

How do you handle oncut, oncopy, and onpaste in jQuery?

The jQuery documentation says the library has built-in support for the following events: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and error. I need to handle cut, copy, and paste events. How be...

Trap the Worksheet Unprotect event in Excel

I have a protected Excel worksheet, without a password. What I'd like to do is trap the event that a user unprotects the worksheet, so that I can generate a message (and nag 'em!). I can setup event checking for the application, for when new workbooks are opened, etc., but not for Unprotect. Does anyone have an idea? ...

How do you raise a server-side event from javascript?

I have a control that is basically functioning as a client-side timer countdown control. I want to fire a server-side event when the count down has reached a certain time. Does anyone have an idea how this could be done? So, when timer counts down to 0, a server-side event is fired. ...

how to pass an event from a child object in a generic list to the parent?

hi, here is my example code: Public Class Parent Private _TestProperty As String Private WithEvents _Child As IList(Of Child) Public Property Test() As String Get Return _TestProperty End Get Set(ByVal value As String) _TestProperty = value End Set End Property ...

Can I change the event queue priority in JavaScript?

I need a distinct sound to play when a error occurs. The error is the result of a problem with one of perhaps two hundred barcodes that are being inputted in rapid fire. The event queue seems to handle keyboard input (which the barcode scanner emulates) first, and playing of my sound second. So if the barcodes are scanned quickly, the...

What is the event precedence in JavaScript?

What order of precedence are events handled in JavaScript? Here are the events in alphabetical order... onabort - Loading of an image is interrupted onblur - An element loses focus onchange - The user changes the content of a field onclick - Mouse clicks an object ondblclick - Mouse double-clicks an object onerror - An error occurs wh...

About Asp.Net DataList Commands And EventValidation

I have Datalist that is inside an updatepanel and it is in panel in modalpopupextender; I can list items as I wanted. I am also putting 2 buttons nfor Delete and AddBelow. Here is the markup: <asp:DataList ID="SpeedDialsDL" runat="server"> <ItemTemplate> <table id="speedDialValueEditorTable" width="1...

Why does the ItemAdd Event stop being Handled on my Sent Items folder?

Hi, I am having some trouble keeping an event handle alive for some reason. My project is an outlook addin which prompts the user to do something when they send an email. Now, I have an event handler hooked up to the Sent Items folder so that when the sent email arrives in that folder it fires the prompt. The reason I have it attached ...