473,797 Members | 3,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1213
On Oct 14, 1:23*pm, "Peter Duniho" <NpOeStPe...@nn owslpianmk.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
1994
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 suggestions for re-wording provided by Michael Winter. Other changes are listed below. Fore those interested, a zipped snapshot of the entire FAQ and notes, as it now is, is available at:- <URL:...
4
7236
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 error" in the exception message. I am able to do this fine with another .aspx page that has no code-behind. The page that has code-behind throws the exception. What I am doing is getting the .aspx response, reading the stream, replacing
1
9237
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 example WebForm1.aspx and WebForm1.aspx.cs code below: WebForm1.aspx =======================================================
3
3794
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 form, it stops updating it, but keeps on incrementing the Progress bar values in the background and displays the updated Pbar after finishing the operation G1. My requirement is that it should update during the execution of operation G1. On...
30
3407
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 commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on the dataset or connection? TIA
5
3854
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 to the object has occurred correctly; have I got a foobar somewhere, or is this the expected behaviour? I can "fix" it by adding an additional few lines (follows main code), but this is ugly; any ideas? And can I get a robust MVP-style UI in a...
22
3094
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 created / destroyed at user request). I can check form != null to prevent incorrect access. But, the form could disappear immediately after the check, before the method is run. Or someone could click 'close' when it's in the middle of an update. ...
6
2638
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 with SQLServer back- ends and I'm wanting to change those queries that can be changed to pass-thru queries using T SQL were I can. UPDATE tblHospLineFinal INNER JOIN tblCodes ON tblHospLineFinal.RemarkCode = tblCodes.CodeID SET...
4
1446
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 the source code gets longer and dirtier. Note :The code below is NOT the actual code, but an example. (I say this, because sometimes people points out that the sample code won't complie, even if it's just an example to explain the matter. ......
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10469
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10209
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.