event-handling

Subscribe for outlook events from VSTO Add-In

Hi every one I need to interact with outlook in a way that, when a task is deleted in outlook, I get notice about and if the task has the text "HELLO" in it's body, show a MessageBox. My add in is in VSTO 2005, and it's for Office 2007. The only way I see to accomplish this is to subscribe for the Outlook events but after a couple hou...

How can I bind many event handlers to one event using jQuery?

I'm experience strange behaviour with jQuery while trying to attach more than one event handler to a single event. How would I bind two different event handlers, to the same event? $(this).focus(function(){/*...*/}); $(this).focus(function(){/*...*/}); // replaces the previous one? What am I missing? Update Do you know if it affect...

ASP.NET Event Handler for label in Datalist

Hey guys, I'm working on an ASP.NET page, and have a DataList with a non-visible label, ID, inside of it. The Datalist is populated by Query A. I'm trying to add a handler in my VB code where it will run Query B, populating a different label in the Item Template, after ID is changed. I figure I need to go somewhere in the DataList, but...

How to "unbind" an event handler attached to an event in the base class when I'm in a derived class?

I had once a situation where I had to override the event handler in some derived class of mine. I could not unfortunately just "override" it since the implementation logic was bound strictly to that particular method implementation in the base class. My natural idea was to first "unbind" the original event handler from the event and the...

Locating (file/line) the invocation of a constructor in python

I'm implementing a event system: Various pieces of code will post events to a central place where they will be distributed to all listeners. The main problem with this approach: When an exception happens during event processing, I can't tell anymore who posted the event. So my question is: Is there an efficient way to figure out who cal...

How to register events for postback with RenderControl?

I am using RenderControl in a string builder to add a dropdownlist in a asp:TreeView. My dropdownlist is set to autopostback and I have an event on the SelectedIndexChanged attached. Unfortunaltly, I see my dropdownlist correctly populated inside my treeview, but changing the selection ain't raising events. here is my code : DropDownLi...

Disabling LostFocus behaviour when editing a cell in Silverlight 2 DataGrid

I have a custom CellEditingTemplate that has a textbox and a calendar control inside a grid. I've made the textbox receive the focus when the user edits the cell by pressing F2 on the keyboard. Unfortunately Silverlight's data grid hooks up to the Grid's LostFocus event so when the user clicks on the date picker control, the LostFocus ev...

Why does the Main Run Loop put an Execution Thread to sleep if there is no event occuring?

I dont understand why Threads have to "sleep" if there is no event in the Application Run Loop. Does this save energy, or memory, or what else? When there comes in an event from an source input, then it would wake up that Thread again to handle this event. After that, it would sleep again, for the case that there is no more event in the...

Overwriten "this" variable problem or how to call a member function?

I have this class where I am using a combination of jQuery and prototype: var MyClass = Class.create({ initElements: function(sumEl) { this.sumEl = sumEl; sumEl.keyup(this.updateSumHandler); }, updateSumHandler: function(event) { // Throws error here: "this.updateSum is not a function" this.updateSum(); }, updateSum: funct...

Setting up a Gallery of Images with NetBeans

I want to display a set of images (with associated text) on my window. I want to iterate through them using a previous and a next button. So far, I have only been able to associate the image with a JLabel. =/ How do I go about doing the rest? Should I use a different container for the complete set? Should I load the images on a data str...

Flex event handling

I have added an event listener for a particular event, for e.g. CollectionEvent.COLLECTION_CHANGE. Inside that event listener, based on a certain condition, I want to call the default event handler for that event. How is it possible? One way I can think of it is : Inside the event listener : If(Condition) { Remove event listener ...

How to overwrite jquery event handlers

I'll try to explain the problem with a simple code. var fireClick = function() { alert('Wuala!!!') }; $('#clickme').click(fireclick); $('#clickme').click(fireclick); So now it will obviously alert 2 times but i need it alert only once. Tried so many ways, but no result. Thanks. ...

LongClick event also triggers Click event

I use onLongClick and onClick events of a button to get user inputs. Whenever; the user long click and triggers onLongClick event, the onClick event is also triggered. I couldn't find my problem. The code of two methods are shown in below: @Override public void onClick(View v) { switch(((Button) v).getId()) { case R.i...

Event capturing vs. bubbling with a contentEditable div

I am dealing with a content editable div and I need to deal with capturing key strokes both before and after the character has been added to the div. My understanding of capturing vs. bubbling is that the event gets captured at the highest level in the dom tree first then passes it down, while for bubbling it starts at the lowest level ...

What's wrong with calling Invoke, regardless of InvokeRequired?

Hi, I've seen the common setup for cross threading access to a GUI control, such as discussed here: http://stackoverflow.com/questions/571706/shortest-way-to-write-a-thread-safe-access-method-to-a-windows-forms-control All the web hits I found describe a similar thing. However, why do we need to check InvokeRequired? Can't we just cal...

How do you handle an event raised in your class inside your own class?

I have a "partial" class in VB.NET. Half of it is auto generated by a code generation tool. That half implements INotifyPropertyChanged, so any properties in that part of the partial class raise the PropertyChanged event. In my "custom" part of the class, I declare another property that depends on one of the properties in the auto-gen...

updating a column on checkin through event handler

Hi, i have written the following event handler code to update a column in the document library, on checkin of a document: Select Case listEvent.Type Case SPListEventType.CheckIn sLog = sLog + "Newest Item is Checked-out" + vbCrLf Dim ApproveStatusBoolean As Boolean = True For Each oField In oItem.Fields If (oItem("ApproveSt...

Creating a Loop to Pause a Script While a Callback Function Operates

Hello All, I am currently using a third party component to handle telnet connections in .NET. I want it to be synchronous where I send a command to the receiving telnet server and then I get the response back as text or byte array. Only problem is that the component is not set up to do that. The component allows me to send commands t...

Changing the default modal result of a form.showModal

In my Delphi application I have a custom Yes, No, Cancel dialogue, which will be called from the main form to confirm saving the changes made to the current file edited. This would normally be achieved by messageDlg() but I wanted this dialogue to have customised looks, so I am trying to achieve this functionality by case myDialogue.sh...

C# Console App + Event Handling...

Hey all. I'm trying to see about handling events in a console application. I would prefer to not use silent WinForms (though I understand that that's one way) to do it. I've read over a similar question and its response. See response text below (link): The basic requirement of an STA thread is that it needs to run a message p...