events

How would I create a theme setting event receiver for Sharepoint 2010?

Currently we have a custom theme applied to Sharepoint 2010 main page. When a new site is created, it has the default theme. We would like all newly created sites on this Web Application to use a specific theme that we specify. I would like to create an event receive for Sharepoint 2010 that sets a specific theme when a new site is prov...

Dynamically loaded user control with Event Handlers - Unregister

I have a form with a panel on which I dynamically load multiple user controls. I handle events for each of these controls. UserControl userControl1 = LoadControl("control.ascx") as UserControl; userControl1.Event += new ControlEventHandler(userControl_Event); this.Panel.Controls.Add(userControl1); UserControl userControl2 = LoadControl...

Silverlight DataGrid makes the first selection when ItemsSource is Set, how can turn this off?

Hi Guys, I am using Silverlight 4 DataGrid with DataPager. When the DataGrid's ItemsSource is set, it selects the first row in the list. PagedCollectionView _list = new PagedCollectionView(myDataCollection); _dataPager.Source = _list; _dataGrid.ItemsSource = _list; The problem is that I have _dataGrid.SelectionChanged event, which ...

Handling ATL/ActiveX events from within JavaScript

I have an ATL ActiveX control that raises three events (Connected, Authenticated, Disconnected) which need to be handled in IE/JavaScript. So far as I can tell, I'm doing everything right, specifically: (1) I've told ATL to implement the IProviderClassInfo2 interface, as described here. (2) I've implemented connection points within my...

how to implement this process in xwpython?

in wxpython, is there a event that can occur when one of the function of the panel or frame is called? thanks; for example, self.Bind(wx.EVT_Onfunctioncalled, self.OnDoSomething) Well, I have to changed this question to a more specific one as follows: I mean, well, the following process: I click on the menu "file" on the main window (a...

Asynchronously Processing a Batch Request in Serialized Order

I have a request that contains a batch of "tasks" that need to be completed. An "asyncstate" object that gets passed around via both the request/response contains a collection of "PendingTasks" and "CompletedTasks". Once a task has been complete by a request handler, it gets moved into a "CompletedTasks" collection. If the original re...

Event listener vs event handler

Can someone explain what is the proper way to make certain actions call functions in javascript? Should I use event handlers like onclick="callFunction();"? Or should I use an event listener? If yes, how do they work? ...

Invoking a method at the end of Cocoa's main event loop

How would it be possible to invoke a method at the end of Cocoa's main event loop after each iteration? I want to do the exact same thing that NSManagedObjectContext's -processPendingChanges does. According to the documentation, "In AppKit-based applications, this method is invoked automatically at least once during the event loop (at ...

Can the unload Event be Used to Reliably fire ajax Request?

I need a method to monitor user edit sessions, and one of the solutions I'm reviewing will have me using an unload event to send an ajax request to inform the server of the end of the edit session. (See: http://stackoverflow.com/questions/3530165/monitoring-user-sessions-to-prevent-editing-conflict) My (rather limited) reading on the un...

Get correct QGraphicsItem

I have a custom class derived from QGraphicsItem. In that class I have private data member which is QGraphicsSvgItem. In my custom class constructor I am creating a QGraphicsSvgItem and its parent as my custom class. Below what I did. class CustomItem : public QGraphicsItem { private: QGraphicsSvgItem *svgItem; } CustomItem::C...

Contravariance problems with event properties

Suppose I have a simple EventArgs subclass: class MyArgs : EventArgs { } Consider I have two classes with events: class MyData { public event EventHandler<MyArgs> Method; } class MyObject { public event EventHandler Method; } And a simple program that uses them: static void Main(string[] args){ MyObject o = n...

Firing a Button's Click event from outside Button

I have a Button and I need to fire it's Click event externally from actually clicking it. However, the code myButton.Click(this, EventArgs.Empty); gives me the error The event 'System.Windows.Forms.Control.Click' can only appear on the left hand side of += or -= How can I fix it? ...

Good links/books about JavaScript event handlers

I have been playing around JavaScript for a year or so, one thing I learned is that event handling has to be done very carefully so now I would like to learn JavaScript event handling very seriously. One of the reason to be so serious is that I would like to try hands on some small game in JavaScript using Canvas and I would like to po...

C# - Adding an Event Handler for all instances of a class.

I have to add an unknown number of buttons to a form in WPF (It's actually a toolbox whose element are loaded dynamically). I'm looking for a way to make one event handler for all of these instances. Is this possible? And they're not exactly just buttons, It's a class that inherits the Button class and has some other member variables. Wi...

Reflection: Distinguishing event-field from field of delegate type on runtime

The main question I have is: Is it possible in reflection to distinguish a field of some delegate type from a field which is used by an event as storagefield? That comes down to the question: does the FieldInfo class contain information about whether it belongs to an event, as storagefield ? I can't find any properties which might tell...

Expose a Click event of a button inside a UserControl in Silverlight

I have a button inside my UserControl. I have three instances of this UserControl on the same page. How can I expose the click event of the button inside such that I can assign different events for each instance of my UserControl. I think this is similar to concept behind exposing DependencyProperty but I don't understand how to do i...

Should I allow a plugin to crash my application?

I am adding an event driven plugin api to a web based system I am working on. Should I wrap the plugin calls in a try/catch to make sure they don't crash or should I leave this up to plugin developers to take care of. Also, some of the plugins may change the data I pass them, should I re-validate all the data or trust the plugin develo...

How can i set up a windows service to listen to events on a remote machine

I have a asp.net web app and a windows service running on separate machines. How can i enable the windows service subscribe/listen to events raised by the asp.net app on the remote machine? What methods can i use? An example of events that can be raised on the asp.net app is a user uploading a file. Once the upload has completed the ...

CommandEventArgs null value in OnCommand event handler for a Custom WebControl implementing IButtonControl

Hello everyone. I am very sorry for the long title but I really didn't know how to be more self explaining than this. The problem I have is this: I designed and developed a WebControl which consists in a simple set of elements that, combined togheter in the simplest way, defines a custom button. This control is the one I would like to u...

Capturing KeyPress Event in WIndow Service.

I am trying to create a window service to create a small keylogger application. I am new to window service and sole purpose is to learn. How all the events that are available in winforms can be obtained in window service. I am searching for it on google. But not getting good stuff and currently reading about keyhook dll ...