events

Event on Item Marked as Read in Outlook - Delphi COM Add-in

I have a Delphi COM Add-in for Outlook (2000-2007) and am trying to find a way to register an event when an MailItem in Outlook is marked as read. I want to add an additional property to the item as/just after it is marked as read. Does anyone have any idea how to do this using the Outlook Object Model? I am also using Add-In-Express ...

Why use EventArgs.Empty instead of null?

I recall reading, on multiple occasions and in multiple locations, that when firing the typical event: protected virtual OnSomethingHappened() { this.SomethingHappened(this, EventArgs.Empty); } e should be EventArgs.Empty if there are no interesting event args, not null. I've followed the guidance in my code, but I realized that ...

C# Generics wont allow Delegate Type Constraints

Is it possible to define a class in C# such that class GenericCollection<T> : SomeBaseCollection<T> where T : Delegate I couldn't for the life of me accomplish this last night in .NET 3.5. I tried using delegate, Delegate, Action<T> and Func<T, T> It seems to me that this should be allowable in some way. I'm trying to implement my o...

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 to fetch the middle mouse button in java?

I use public boolean mouseDown(Event ev, int x, int y) to detect a click of the mouse. I can distinguish between the right mouse button (ev.metaDown() is true) and the left and middle. How can i differentiate the left from the middle button? Or if it is impossible with mouseDown, what should i use? ...

What is the difference between the onMouseUp/Down and onPress/Release events in Flash?

In Flash, there seem to be two sets of mouse click events: onMouseUp, onMouseDown onPress, onRelease Is there any actual difference between these events? I can't tell from the documentation, and I haven't noticed anything in actual usage, but it seems odd to have two different sets of names for the same basic events. Am I missing s...

How would you notifiy clients about changed data on the server using .Net 2.0?

Imagine a WinForms client app that displays fairly complex calculated data fetched from a server app with .Net Remoting over a HTTPChannel. Since the client app might be running for a whole workday, I need a method to notify the client that new data is available so the user is able to start a reload of the data when he needs to. Currentl...

How to audit when a user leaves an ASP.NET app

In ASP.NET, I'm looking for a way to audit a user leaving my application. To be specific, I'd like to insert a 'logout' record in an audit table in SQL Server when the user's session is abandoned/destroyed for any reason (not necessarily because of a call to session.abandon) I have a 'SessionHelper' class that manages the session setter...

jQuery: Event binding on dynamically created elements?

Hi All, Thanks for reading. I have a bit of code where I am looping though all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouseon/off. This happens on page ready, and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loo...

Are you using event streaming products?

Maybe you're familiar with the concept of event streaming processing (ESP) ... if you are, I'd love to hear what you're using and what platforms you're using them on. I am an active contributor to the Esper project (http://esper.codehaus.org/) but I'd be interested in hearing what others are using? Anyone using Coral8, Aleri or Streamb...

How to declare lambda event handlers in VB.Net ?

I believe the following VB.Net code is the equivalent of the proceeding C# code; however the VB.Net test fails - the event handling Lambda is never called. What is going on? VB.Net version - fails: <TestFixture()> _ Public Class TestClass <Test()> _ Public Sub EventTest() Dim eventClass As New EventClass Dim ev...

Events and Delegates with ASP.NET master pages

How do you catch a custom event raised by a master page? On my master page I have a custom event and delegate: public event SignOutHandler SignOut; public delegate void SignOutHandler(); This is raised when a link button on the master page is clicked. if (SignOut != null) { SignOut(); } In a user control on the page I'd like to s...

Data disappearing after ItemUpdate in Sharepoint with Office 2007 documents

I have a simple event handler with a ItemAdding event that changes a column value that I need in the ItemUpdated method. After uploading a word 2007 document (*.docx, *.pptx or xlsx) the value of the column is changed, but when I protect the document the value of the column disappears in the ItemUpdated method. This only happens for off...

Help with <key> event in python Entry widget

Hey, I'm writing some code in python and I'm having trouble when trying to retrieve content of an Entry widget. The thing is: I want to limit the characters that can be typed, so I'm trying to clear the Entry widget when I reach the specific number of characters (2 in this case), but it looks like I always miss the last typed character....

OnKillFocus() override in MFC triggering at odd times.

I need to know when my Window goes out of input focus, so I overloaded the OnKillFocus() method of the CWnd. However it doesn't invoke this method when I focus another application (alt+tab), or even minimize the window. But it DOES invoke the method when I restore it from being minimized. Are these the intended times for it to trigger ...

Launch an event that has accessors

Hi, How can I launch an event that has accessors like this : public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } If it were a normal event I would launch it by: CanExecuteChanged(sender, EventArgs..). ...

Javascript registering event to object

Hello all, I have an activex object I loaded into an html page. I then use that activex object to create another object, but I need to register an event with the new object created. The object is expecting an event listener of a certain type. I can load this same dll in c# and it will work fine. Code looks like this for c#. upload =...

Why must someone be subscribed for an event to occur?

Some text before the code so that the question summary isn't mangled. class Tree { public event EventHandler MadeSound; public void Fall() { MadeSound(this, new EventArgs()); } static void Main(string[] args) { Tree oaky = new Tree(); oaky.Fall(); } } I haven't used events much in C#, but the fact that ...

I need some help with cursor event handling in python+Tkinter

Hey, I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button... So far i only came out with the idea to bind to TAB and mouse click, although if i bind the mouse click to the Entry widget i only get m...

How do C# Events work behind the scenes?

I'm using C#, .NET 3.5. I understand how to utilize events, how to declare them in my class, how to hook them from somewhere else, etc. A contrived example: public class MyList { private List<string> m_Strings = new List<string>(); public EventHandler<EventArgs> ElementAddedEvent; public void Add(string value) { ...