events

XmlSerializer throwing InvalidOperationException

I have an XmlSerializer object, and I have added 2 event handlers to the UnknownElement and UnknownAttribute events, as below: XmlSerializer xs = new XmlSerialiser(typeof(MyClass)); xs.UnknownAttribute += new XmlAttributeEventHandler(xs_UnknownAttribute); xs.UnknownElement += new XmlElementEventHandler(xs_UnknownAttribute); Each of th...

IPhone app - invoke function on incoming call

I have a piece of code (my app) which I want to run for each incoming call in the iphone. So I'm looking for a function like: On Before Incoming Call (); is there anything like that? ...

Why doesn't onkeydown working properly on IE?

function checkEnter(event) { var charcode; if (event && event.which) { charcode = event.which; alert("Case 1. event.which is " + charcode); } else if (event && !event.which) { charcode = event.keyCode; alert("Case 2. event.keyCode is " + charcode); } document.getElementById("text1...

Subscribing to Event Handlers

I'm curious about the pros and cons when subscribing to event handlers. <asp:DropDownList id="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" /> vs protected void Page_Init(object sender, EventArgs e) { this.DropDownList1.SelectedIndexChanged += new EventHandler(DropDownList1_SelectedIn...

Javascript event simulation library

Do you know a JS library for dom events simulation? I know that this operation can be done but i can't find any library to do it. UPDATE: I try to explain better my question. Javascript can simulate events like the user click, i'm looking for a library that helps me with this operation. ...

Remove events without knowing their names

Is it possible to instead of doing this: person.Walking -= person_Walking1; person.Walking -= person_Walking2; person.Walking -= person_Walking3; Do this: person.Walking = // remove all the handlers without knowing their names Thanks. ...

IPhone SDK handling calls

Is there any way to handle call events in IPhone? i.e. Log calls and sms in my app, block unwanted numbers, etc. I know the IPhone SDK doesn't provide that but I have been googling this and what I got was an app called iBlackList. Although it runs on jail-broken phones but it does my required functionality. I wonder how? Has anyone idea ...

Why does KeyDown event not have access to the current value of bound variable?

In the example below: I start program, type text, click button, see text above. Press ENTER see text again. BUT: I start program, type text, press ENTER, see no text. It seems that the KeyDown event doesn't get access to the current value of the bound variable, as if it is always "one behind". What do I have to change so that wh...

Is there a way to be notified when the user makes changes in a wxStyledTextCtrl?

I have a wxWidgets application that has a wxStyledTextCtrl. But for the life of me, I cannot figure out how to get notified of modification events. I have the following code: void CMainWindow::OnDocumentModified(wxStyledTextEvent & event) { wxString msg; msg << event.GetModificationType(); wxMessageBox(msg); } This gets c...

C# How to unsubscribe all event handlers from a given event?

Hi Guys, Is there a simple way to iterate all over the handlers subscribed to a given event? my problem is that clients subscribe but forget to unsubscribe so a memory leak happens. I need a way for an object to disconnect all the handlers of its events in the Dispose method so a leak would not happen - at least not because of events. ...

How to programmatically click on a EIT Lightbox hyperling in asp.net

Hi On my webpage Im using EIT Lightbox to display images. I need to click on the Lightbox hyper link by code. I have tried the following body.Attributes.Add("onLoad", "document.getElementById(\"lbh1\").click()\n"); body.Attributes.Add("onload", "eval(document.getElementById(\"lbh1\").href);\n"); But neither seems to work. If I use th...

Click event keeps firing

I have absolutely no idea why this is happening but the following code seems to be executed a huge amount of times in all browsers. $('#save_albums').click(function(){ for(var i = 1; i <= 5; i++){ html = $('#your_albums ol li').eq(i).html(); alert(html); } }); Looks fairly innocent to me... Here's the code in ...

How can I make my Perl Jabber bot an event-driven program?

I'm trying to make a Jabber bot and I am having trouble keeping it running while waiting for messages. How do I get my script to continuously run? I have tried calling a subroutine that has a while loop that I, in theory, have set up to check for any messages and react accordingly but my script isn't behaving that way. Here is my sour...

Page Loading Screen in PHP

Hi all, I am working on a Php page which loads more images,so I want to show the User as the Page is currently Loading. I have tried but it does not working correctly. The loading image should be run until all image gets load.How to implement for this? ...

Wpf: Treeview updated or datatemplate applied event

The scenario is: In my Window, I have a TreeView, each item of this represents different user-defined types, So I have defined DataTemplate for each type. These DataTemplates are using user-controls and these usercontrols are binded with properties of user-defined types. As simple, TreeView maps a Hierarchical Data Structure of user-defi...

is there any column click event in ext js ?

I am using Ext.grid.gridpanel.As in rowclick event, we can handle row click of grid..Is there any event to handle column click of grid? i want to select a particular column of grid. ...

Repeater itemdatabound event value type and reference type

Im trying to bind a list with datetime objects to my repeater. if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { DateTime actualDate = e.Item.DataItem as DateTime; } When I want access the itemdatabound event on the repeater Then I get an errorme...

How can I determine if a UILabel was touched?

I am trying to determine if a UILabel was touched and if so do something. Give .. . . . UILabel * site = [[UILabel alloc] initWithFrame:CGRectMake(0, 185, 320, 30)]; site.text = [retriever.plistDict valueForKey:@"url"]; site.textAlignment =UITextAlignmentCenter; site.backgroundColor = [UIColor clearColor]; site.textColor = [UIColor whit...

How to get a continuous Touch Event?

My class extends View and I need to get continuous touch events on it. If I use: public boolean onTouchEvent(MotionEvent me) { if(me.getAction()==MotionEvent.ACTION_DOWN) { myAction(); } return true; } ... the touch event is captured once. What if I need to get continuous touches without moving the finger? Pleas...

How to test if raising an event results in a method being called conditional on value of parameters

I'm trying to write a unit test that will raise an event on a mock object which my test class is bound to. What I'm keen to test though is that when my test class gets its eventhandler called, it should only call a method on certain values of the eventhandler's parameters. My test seems to pass even if I comment the code that calls Pro...