events

Subscribing to events in a separate class

Hi there, I am having a bit of trouble subscribing to an event I have created. The event itself is in its own class and I want to be able to subscribe to it from a separate class in a separate project. I am able to subscribe to it from the class in which it is created - but when I try to subscribe from a different class in a different p...

[jQuery] Show LIs based on ID in sequence

I'm working on creating a for-loop that calls a javascript effect and applies it to an LI, doing it in sequence. Here's what I've got: $(document).ready(function () { for(i=1;i<=10;i++) { $("li#"+i).show(); } }); However, this doesn't work. I need it to apply the effect to LI#1 then LI#2, LI#3... and so on. What I'm tryi...

JSON stringify error on Silverlight event argument

I have the following Silverlight code: [ScriptableType] public partial class Page : UserControl { [ScriptableMember] public event EventHandler<UploadChangedEventArgs> OnFileProgressChanged; private void FileProgressChanged_Click(object sender,RoutedEventArgs e) { // test reasons only OnFileProgressChanged(null...

Observer pattern implemented in C# with delegates?

There is a question already answered which is http://stackoverflow.com/questions/32034/in-c-isnt-the-observer-pattern-already-implemented-using-events It asks if the observer pattern is already implemented in c# using events. While I get the events and observer pattern, isn't the observer pattern really just delegates and events is a f...

C# AC Power Connected / Disconnected events

I'm writing a desktop application and would like to know if there are any events that get fired on AC power status changed. ...

How to graph streaming data in C#

I need to graph streaming data (9600 baud), which is coming in 2-4 byte packets from a serial port. The packets need to be processed before graphing. Currently, I am raising an event on each complete packet, which is causing responsiveness issues on the graphing form. Which is the best solution to this issue: Buffer data and raise b...

Capture event onclose browser

Hi! How I can capture event, close browser window, in jQuery or javascript ? ...

How to handle subscription to generic type's events?

I am working on a WinForms app. There are many instances where I need to display a new screen in the small viewing area, so I am using Panels. Basically, I inherit from panel, expose any properties for the information I need from the panel, anything that needs to happen to display information in the panel happens in it's own code behind....

jquery or javascript page re-SCAN?

Hi Guys, I have a js script on my blog page that scans the page, looks for special snippets similar to bb code and translates it into an image. For example, i search for all instances of [ ] and replace it with a box image, or all images of :) and replace it with a smiley. I also have a live preview script for my comments. My problem is...

Handle ActiveX Control Event in C#

I have an ActiveX control (an OCX file) which raises an event. I want to catch that event in C#. How do I go about doing it? I can catch the control's event in JavaScript, here is the code for that <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body > <script ...

How to use "this" properly to access the form controls?

Hello, In my case I have panels,but to make it clear I will use buttons in my example. I have 5(or more) buttons and I set an event,for example - OnMouseHover, to all of the five buttons.How do I get ,which one has the mouse hovered if all the events link to one method To capture the button where the mouse is hovered,I tried using "th...

Alternate to SqlTransaction exposing Events - C# ?

Hi, I want to perform some logging when a SqlTransaction is committed or rolledback. I see that SqlTransaction class does not expose any such events like OnCommit or OnRollback. damn! SqlTransaction class is sealed, I cant help it out with inheritance. Now, what must be the reason they have not allowed these events to happen ? Is th...

ActionScript event handler execution order

I have been trying to understand the way ActionScript's events are implemented, but I'm stuck. I know that AS is single threaded, which means that only one event handler will be executing at a time, and also means that handlers will be executed in a deterministic order*. For example, consider the following code: 1: var x = {executed: ...

The event BeforeNavigate2 in Windows Internet Explorer 7 does not fire

I have a VB6 Application which creates an instance of the internet explorer and implements drag and drop for this instance. I am using the event BeforeNavigate2 so that when user drops a file or a folder on the explorer, the event will return the path. ...... Public WithEvents myIExplorer as new SHDocvW.InternetExplorer ...... Private S...

Flex return back the result after the event complete

I have two functions in a actionscript class, they are: private function loaderCompleteHandler(event:Event):void { _loader = Loader(event.target.loader); selectedBitmap = Bitmap(_loader.content); } public function byteArrayToBitmap( byteArray:ByteArray ):void { _loader.contentLoaderInfo.addEventListener( Event.COMPLETE,...

Is there a standard way to implement "Vetoable" events?

I'm using events as part of a game model, and for extensibility and code "locality's" sake I need to be able to veto most actions. More clearly, nearly every method that has a side effect takes this form: public event TryingToDoSomethingHandler TryingToDoSomething; public event SomethingHappenedHandler SomethingHappened; /* * Retur...

Perform dragdrop implementation after DoDragDrop method is called

Hello I've been struggling with this for quite a while My application contains a list view, populated with file-names, which are located on a server. I'm trying to implement drag and drop functionality, so the user can drag files from my application into his/her's local computer. In order to do this, first i'm downloading the files i...

C#: Thread-safe events

Is the implementation below thread-safe? If not what am I missing? Should I have the volatile keywords somewhere? Or a lock somewhere in the OnProcessingCompleted method? If so, where? public abstract class ProcessBase : IProcess { private readonly object completedEventLock = new object(); private event EventHandler<ProcessComp...

.NET UserControl: Size property gives incorrect value on Resize event

Excuse the code dump, these are functions within a UserControl private void PNGQuantPreviewControl_Resize(object sender, EventArgs e) { createOffScreenBm(); draw(); } private void createOffScreenBm() { offScreenBm = new Bitmap(this.Size.Width, this.Size.Height); offScreenGfx = Graphics.FromImage(offScreenBm);...

Alternative for Report.Load() event in Ms Access 2003

I created an application in Access 2003 and continued to work on it on another computer with Access 2007. I created a report with a method that loads data from a recordset to some unbound fields on the report. This method takes three parameter values from three fields on the report. The report's data source is a query. I call the method...