events

Im trying to raise a event when a file is updated in C#

i know this code dont work but is describes good what im trying to do, i want to run the code inside the if check when Lastwritetime is greater then oldvalue date. private void timer1_Tick(object sender, EventArgs e) { DateTime lastWriteTime = File.GetLastWriteTime(@"C:\temp\test_folder\TestFile.txt"); if (lastWriteTime.ToStrin...

How to bubble key events from a control up to a form?

I am aware of the KeyPreview property of a Windows Form, and this allows the Form to receive the key events before they get passed to the focused control. However, I want the Form to receive the event after it has been to the focused control. As a test I have placed a TextBox on a Form. Upon typing in the TextBox it should perform it's...

.Net events - blocking subscribers from subscribing on an event.

Let's say I have a "Processor" interface exposing an event - OnProcess. Usually the implementors do processing thus I can safely subscribe on this event and be sure it will be fired. But one processor doesn't do processing - thus I want to prevent subscribers to subscibe on it. Can I do that? In other words in the code below I want the l...

What are the benefits of having events conforming to Net guidelines?

I understand how to use Events according to Net Framework guidelines, but what are the benefits of using this pattern? http://msdn.microsoft.com/en-us/library/aa645739%28VS.71%29.aspx : The .NET Framework guidelines indicate that the delegate type used for an event should take two parameters, an "object source" parameter indic...

Given an event on one thread, what is the best approach to execute a task/method on another thread in .Net?

Here is specifically what I am seeking to accomplish: Using .Net 3.5, I have a Windows Service, within which I have a WCF Service running. I have a client, which requests a file from the WCF Service (Net.Tcp binding), which is then copied by the WCF service to a specified location, where it can then be edited/modified by the client. The...

How does an OS or a systems program wait for user input?

I come from the world of web programming and usually the server sets a superglobal variable through the specified method (get, post, etc) that makes available the data a user inputs into a field. Another way is to use AJAX to register a callback method to an event that the AJAX XMLhttpRequest object will initiate once notified by the bro...

Event listener loop

how do i add a listener for hovering over div tags like this: | btn1 | btn2 | btn3 | btn4 | i want to add a listener that loops through them like i show below and then applies a function if it has mouseover. function listen() { for (i=1;i<=10;i++) { wat = document.getElementById('btn'+i); wat.addEventListener('mouseover',functi...

How might I handle a double click event using jQuery?

Is there a way to bind an event handler to a double click with jQuery instead of single click? ...

How can I capture a component's render event in Google Web Toolkit?

I'm building an application using EXT for GWT (i.e. GXT). In GXT, every component that can be added to a page has an associated Render event that can be captured and handled. Due to some limitations I need to step down to pure GWT for a small portion of my application. Specifically, I want to modify the RichTextArea widget by adding s...

Blocking event subscription in compile time.

Related to my previous question. Is there a way to block the subscription in compile time? Something like marking the event's "Add" as "private" in the implementor even though it's public in the interface. ...

Detect when a user arrives at the end of a readonly textarea in an html page

I need to detect when a user arrives at the end of a readonly textarea in an html page. The textarea will display a very long log for an application. The logs files are so big that is impossible to load all the text in one time (some log files are almost 200 MB). So I will load the first, say, 1000 lines, and then I need to detect when ...

C# WPF Controls within Controls and distinguishing LeftClick events!

I have UserControls within UserControls in WPF. This makes a tree structure starting from the root node. I want to register for the event MouseLeftClickDown in all the UserControls. Left Clicking on a child control causes the event to fire for that control and all the parent controls that contain that child. When I click a child, I do...

Carbon - OS X - Sending modified key events using CGEventPost

I'm trying to programmatically send modified keystrokes, for instance a capital "A". The problem is that the shift modifier does not seem to have any effect. In my code, I have two events, one for the shift key down, and another for the 'm' key down. CGEventRef mDown = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)46, true); CGEventRef ...

Interacting with the hibernate Session during event calls

Hi all, I want to write a history component that tracks changes to a particular object type and writes history rows based on the difference. Note this is not a general audit system it is specific for one object type. I figure I can hook into the hibernate event model and listen for events that tells me when things have changed, watch ...

c# event handling problem

Hi, I have a class which provides a custom event: public delegate void ResultEvent(bool result); public class Service : INotifyPropertyChanged { public event ResultEvent Result; } Two other objects have a refernce to this like this: public partial class SomeRandomClass { private Service service; public SomeRandomClass(...

Are events the OO equivalent of GOTO?

Was just thinking about this question while trying to figure out some code written by our previous developer. Trying to trace out how control of the program was happening reminded me of the bad old days of BASIC, where it was hardly ever obvious the execution path of a program. Is this more a symptom of event abuse, or is there a struc...

value set by javascript is not saved in asp.net

hi, i am having two textboxes and a label in a gridview control, i am adding a javascript function to the second textbox onblur event attribute and display the result in the label, the function works fine and result is displayed in the label, but when i am saving the grid data into the database, the label is returned 0 or empty, but i am...

Capturing changes to MailItem.SendUsingAccount property in Outlook

I am working on an Outlook extension that requires making a change to a MailItem open in a compose window if the SendUsingAccount property is changed via the GUI. I would like to be albe to apply my changes automatically, but I cannot find any events that are raised when the user makes the change. I have tried listening to the followin...

Talking Among GWT Panels using UIBinder Layout

New to GWT here... I'm using the UIBinder approach to layout an app, somewhat in the style of the GWT Mail sample. The app starts with a DockLayoutPanel added to RootLayoutPanel within the onModuleLoad() method. The DockLayoutPanel has a static North and a static South, using a custom center widget defined like: public class BigLayou...

Javascript: What does the function given to setTimeout get called with?

I have code like this: setTimeout(foo, 600); I always thought that foo didn't take any arguments, e.g.: function foo() { /* bars */ } However, doing the following: function foo(a) { alert(a); /* bars */ } Popped up an alert displaying -7. What does this number represent? ...