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...
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...
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 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
...
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, ...
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();...
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...
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?
...
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...
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...
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;
...
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)...
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...
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?
...
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.
...
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
...
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 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...
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...
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 ...