I use them for "communication" between different objects, as publisher and subscriber pattern.
Is some examples I see that sometimes event is declared as static and sometimes it's not:
public delegate void LogProgress(string str)
public static event LogProgress LogProgressEvent;
if (LogProgressEvent != null)
LogPro...
I'm experimenting with IronRuby and WPF and I'd like to write my own commands. What I have below Is as far as I can figure out.
class MyCommand
include System::Windows::Input::ICommand
def can_execute()
true
end
def execute()
puts "I'm being commanded"
end
end
But the ICommand interface defines the CanExecuteChanged...
Hi all, what is the advantage of raising and event in asp.net user controls?
...
Should an addListener method check for duplicate registrations when called? If so, what should happen when a duplicate is found?
final public class exampleCanFire {
public void addFooListener(FooListener listener) {
// Before adding listener to private list of listeners, should I check for duplicates?
}
}
...
Hi community,
I have a question about event handling with C#. I listen to events a class A throws. Now when the event ist thrown a method is executed that does something. This method sometimes has to wait for respones from datasources or similar.
I think event handling is synchronous so one after another event will be processed. Is it ...
private void NuestroButton1_Click(object sender, RoutedEventArgs e)
{
if //the sender's .Text/.Content is X
{
//Do something
System.Windows.Browser.HtmlPage.Window.Alert("Hello World");
}
}
How can I use something like sender.Text to see what the .Text is of the clicked button?
...
My question is somewhat weird, but can i add events for any DOM elements(div), like
'onHtmlChange', to be notified when that div has changed their content?
...
hi all, i am using GWT 1.6 and i am pretty new to it.
my question is about the use of a button as part of a grid row.
how can the onClick method that the button has refer to the data in the grid?
how i can make the button be aware to its raw and the other data that exists on the same row ??
thanks
Me
...
I'm trying to use EventBus from Jython. Sending events to the from Jython bus works as expected, they can be listened from my Java code. But subscribing to the bus from Jython is problematic. I'm trying this:
class Listener(EventTopicSubscriber):
def onEvent(self, topic, object):
print("got an event")
EventBus.subscribe("To...
I've always assigned event handlers like this, guided by Intellisense auto-completion.
RangeSelector.RangeChanged += new EventHandler(RangeSelector_RangeChanged);
I've recently noticed one of my colleagues does it this way.
RangeSelector.RangeChanged += RangeSelector_RangeChanged;
Both methods are syntactically correct, compile and...
I would like to know if is there some jquery known behaviour that cause the lost of events handlers (in particular in iframes)?
I've a strange kind of problem.
I've built a webapp composed of two iframe.
First i load content in the first iframe. I add some event event handler using jquery to first iframe content dom.
Everything works....
Im using event handlers from a framework (prototype to be specific) to attach listerners to certain elements of a page like this:
//html
<a href="?default=1" class="default">Set Default</a>
//js
document.observe('dom:loaded', function(){
//get all elements with d 'default' classname
for(i = 0;i < document.getElementsByCl...
i want to prevent users from shut down or restart the system. my application runs as a Win32 Native Service (written by C++) and under LocalSystem account.
i heard about WM_QUERYENDSESSION it's solution: creating a hidden window and capturing WM_QUERYENDSESSION to prevent shutdown.
but this solution is not really clean and also have t...
See Also:
understanding events and event handlers in C#
As a web dev, I don't typically have to get into building my own events for objects, since most are inherent in the page. However, now I'm into a pretty complex (web) project where I think I may have to use them. I just read a chapter out of Pro VB 2008 and the .NET 3.5 Pl...
Consider the javascript / jQuery code:
jQuery("<input/>").attr("type", "button").attr("value", "Click me")
.click(function()
{
alert("hello");
})
.appendTo(".someDiv");
This creates a button, binds an event handler to it and appends it to all elements with class "someDiv".
This works as expected ONLY if ...
Hi all!
I have an AHAH-requested HTML, like:
<table>
<tr>
<td>...</td>
<td><img src="..." onClick="get_next_ahah(sell####)" id="sell####"/></td>
</tr>
<tr>
<td>...</td>
<td><img src="..." onClick="get_next_ahah(sell####)" id="sell####"/></td>
</tr>
... and so on
where #### - numerical IDs from DB.
How can I replace th...
So I am a Visual Basic 6 developer moving over to CLR and need an answer to a real newb question.
In Visual Basic 6, if you had an ActiveX control, you could reference that control and then have a statement essentially saying:
Public WithEvents YourControl (Emphasis on the "WithEvents" keyword)
What happen is that in Visual Basic you...
I'm learning a bit of functional programming in Gambit-C Scheme by restricting myself to not using set!. I thought it might be fun to write a little OpenGL game using this environment, which seems to lend itself well to game development.
However, it seems to be difficult to stick to a functional style and avoid global state when using ...
I am building an issue tracking system that uses Silverlight. I use DataGrids to display the issue lists, set the selected index to -1 so that no row appears selected and then use the selection change event to popup an issue details window for the particular selected issue.
When I try to refresh the DataGrid by rebinding it to its Items...
is it possible to execute a function in all events
...