events

stage Event.ENTER_FRAME vs. CREATION_COMPLETE

I've got an AS3 project that I'm building in FlexBuilder. In my main class's constructor, I've got this: stage.addEventListener(Event.ENTER_FRAME, stage_enterFrameHandler); And then the event handler function: private var tempCounter:uint = 0; private function stage_enterFrameHandler(event:Event):void { stag...

How do I retrieve the Subscriber List for an Event at runtime?

When using a Delegate, I can use Delegate.GetInvocationList() Method to retrieve the invocation list of the delegate at runtime. Is there a way to access the subscriber list that has been associated with an event? I ran the code from this example (SO#1237001) and the immediate window allowed me to cast the SecondChange event to a System...

How long is the event onLongPress in the Android?

Android supports an event onLongPress. The question I have is 'how long' (in milliseconds) is the 'press' to trigger the event? ...

problems designing event driven communication

Hey guys, Im struggling a bit with a design issue. Im making a very simple gui system in c#. The code is meant to be reusable so Im looking for the most flexible solution here. The solutions I come up with seem to all have their drawbacks. For simplicity lets pretend there are three classes: controller, button and the client code. The ...

C#: Invoke Event from Locked Block

I have usually heard that it is a good idea to unlock any locks before calling event listeners to avoid deadlock. However, since the lock {} block is reentrant by the same thread in C#, is it OK to call events from a locked block or do I need to make a copy of the relevant state data and invoke the event outside the lock block? If not,...

UnitConverter action problems

I have three ComboBoxes on my form. What is the event so that if an item in Combobox1 is selected, the options in ComboBox2 and ComboBox3 change. ...

Where is Transparent Proxy pointing to?

I am using .Net Remoting. I have a service exposing a singleton class that a client on another machine can register with, so that the server can broadcast messsages to all registered clients. MessageManager mgr = MessageManager.Instance; //Static Singleton Factory Proprty RemotingServices.Marshal(mgr, MesgURI); Now in my service,...

How do I subscribe to an event of an object inside an expression tree?

Sorry I couldn't think of a better title. This is a two part question that only make sense together. Say I have a constructor like this public Fact(INotifyPropertyChanged observable, Func<bool> predicate) { this.predicate = predicate; observable.PropertyChanged += (sender, args) => PropertyChanged(this, new Prope...

2 Events with same name in Reflectored code?

Hello, I work on a project in Silverlight and I wanted to know how does the ObservableCollection work. I was quite surprised to see this in Reflector: public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged { // Fields private bool _busy; // Events public even...

how to capture all changes to the contents of a <body> element in JS

I am trying to write an extension for Google Chrome. I want to capture any keyboard input on a given page, and do something magic to it. I am able to do most of what I need with these lines: document.addEventListener("keydown", function(event) { OnKeyDown(event); }, false); document.addEventListener("keyup", function(event) { OnKeyDow...

Rename Worksheet Event in Excel

What is the best way to get some VBA code to run when a excel sheet is renamed? ...

Only allow one NSWindow to be selectable until action is completed (Cocoa)

Hi all, I have a program with many windows open. I want all windows to be visible, but only one window can be interactable, until a certain event has occured. e.g. pressing a button. At the moment, I can still click another window, and interact with it, how do I only allow interaction with ONE window, until a certain event occurs? Ima...

Full window onClick handler in Firefox and Internet Explorer

I would like an event handler to fire whenever someone clicks anywhere on a window (so I can clear away a menu if they click someplace other than the menu). The following works in Safari: function checkwho(ev) { obj=(window.external) ? event.srcElement : ev.target; var type=obj.nodeName; if ((type == 'BODY') || (typ...

It is possible to pass data to EventArgs without creating derived class?

Hi, I am a bit confused. I know I can create class derived from EventArgs in order to have custom event data. But can I employ the base class EventArgs somehow? Like the mouse button click, in the subscriber method, there is always "EventArgs e" parameter. Can I create somehow the method that will pass data this way, I mean they will be ...

Events and Multithreaded code in .NET

Project is C#. So I have a bunch of multithreaded code that is designed to be run as a library. It's in a seperate project from the UI. My library has a central object that needs to be created before anything that would fire off events is created. Is it possible for this master object to be passed in some objects so that my events can...

Triggering a non-static class from a static class?

I am writing a class library(API) in C#. The class is non-static and contains several public events. Is it possible to trigger those events from a static method in a separate class? For example... class nonStaticDLLCLASS { public event Event1; public CallStaticMethod() { StaticTestClass.GoStaticMethod(); } } class Stati...

How would I go about performing an operation on closing a C# console application?

I'd like to save data from a console application in its final state when closed. I've figured out how to use serialization to save the data, but not how to make this happen when the application closes. One method is to set an unmanaged handler to intercept the close command and perform an operation, however once the event handler has b...

Variable in event

I got this code: <script>window.onload = function () { var container, i; for (i = 0; i < 10; i ++) { container = document.createElement ("div"); container.innerHTML = i; container.style.border = "1px solid black"; container.style.padding = "10px"; container.onclick = function () { alert (i); } document.body....

what is events in c#

what events in c# and give clear real time example and program ...

Detect when a specific <option> is selected with jQuery

Hi, I have the following drop-down menu: <select name='type' id='type'> <option id='trade_buy' value='1' selected='selected'>Buy</option> <option id='trade_buy_max' value='1'>Buy max</option> <option id='trade_sell' value='2'>Sell</option> <option id='trade_sell_max' value='2'>Sell max</option> </select> I'd like jQue...