473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: Update UI from another thread; unnecessary code?

On Tue, 14 Oct 2008 10:01:25 -0700, robert.waters
<ro***********@gmail.comwrote:
[...]
It worked! Thanks!
Perhaps using an anonymous method bypasses the 'take no parameters'
restriction?
That depends on your definition of "bypasses". Using the anoymous method
doesn't remove the restriction; the anonymous method signature _does_ in
fact wind up taking no parameters.

But with an anonymous method, you can "capture" any variable accessible in
the method in which the anonymous method is declared. So rather than
passing the string to the delegate method, the "e" method argument winds
up captured and used within the anonymous method directly.

In that respect, the anonymous method does bypass the restriction, by
allowing you to get data into the anonymous method without passing it.

Pete
Oct 14 '08 #1
1 1203
On Oct 14, 1:23*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Tue, 14 Oct 2008 10:01:25 -0700, robert.waters *

<robert.wat...@gmail.comwrote:
[...]
It worked! Thanks!
Perhaps using an anonymous method bypasses the 'take no parameters'
restriction?

That depends on your definition of "bypasses". *Using the anoymous method *
doesn't remove the restriction; the anonymous method signature _does_ in *
fact wind up taking no parameters.

But with an anonymous method, you can "capture" any variable accessible in *
the method in which the anonymous method is declared. *So rather than *
passing the string to the delegate method, the "e" method argument winds *
up captured and used within the anonymous method directly.

In that respect, the anonymous method does bypass the restriction, by *
allowing you to get data into the anonymous method without passing it.

Pete
So rather than
passing the string to the delegate method, the "e" method argument winds
up captured and used within the anonymous method directly.
Thank you for the explanation.
Oct 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Richard Cornford | last post by:
Anyone who has taken a look at the online FAQ today may have noticed that I have updated it. The majority of the changes are the updating of broken links and the implementation of that extensive...
4
by: Terry | last post by:
Hello, I am trying to get a response for an .aspx page in my current project (same virtual directory) by using WebRequest.GetResponse but I keep getting a exception with "500 Internal server...
1
by: nospamjac | last post by:
Hi, Is there a way to update the text of an asp:label on a webform without refreshing the entire page? What is called by button clicks and other events that refresh a webform control? See the...
3
by: Vinay | last post by:
Hello I am trying to update a Progress bar on a form. I am able to update it via using a simple clock timer, but as soon as I perform a long operation G1 (generation of a report) in a separate...
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
5
by: Marc Gravell | last post by:
In the following example, the Bindings don't update the UI if the property change is triggered from the non-UI thread - see the async button - from the listbox contents (and observation) the change...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
6
by: bobh | last post by:
Hi All, I'm looking for help with what the Transact SQL code is for this Access Update query sql code. I've been doing Access for some time and all my back-ends have been jet. I'm just starting...
4
by: Sin Jeong-hun | last post by:
Hello. Event handlers for events from an object of another thread than the UI thread cannot access UI components, as you know. If the object has many events this precedure is painstaking. Plus...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.