Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: Word Interop: Unable to save text in a document Pin
EliottA16-Nov-09 4:33
EliottA16-Nov-09 4:33 
GeneralRe: Word Interop: Unable to save text in a document Pin
mailtogj17-Nov-09 4:48
mailtogj17-Nov-09 4:48 
QuestionOutlook VSTO Appointment Item Delete Event Pin
Programm3r16-Nov-09 3:52
Programm3r16-Nov-09 3:52 
QuestionHelp with BackgroundWoker Pin
Etienne_12316-Nov-09 3:48
Etienne_12316-Nov-09 3:48 
AnswerRe: Help with BackgroundWoker Pin
Not Active16-Nov-09 4:05
mentorNot Active16-Nov-09 4:05 
AnswerRe: Help with BackgroundWoker Pin
The Man from U.N.C.L.E.16-Nov-09 4:14
The Man from U.N.C.L.E.16-Nov-09 4:14 
GeneralRe: Help with BackgroundWoker Pin
Not Active16-Nov-09 6:23
mentorNot Active16-Nov-09 6:23 
AnswerRe: Help with BackgroundWoker Pin
Luc Pattyn16-Nov-09 7:20
sitebuilderLuc Pattyn16-Nov-09 7:20 
There is an alternative:
- do not use a BGW
- use a System.Threading.Timer with due time equal to 0, and an infinite period (that makes it a one-shot timer).
- in the timer callback method:
   * get the weather info;
   * use the InvokeRequired/Invoke pattern[^] to update the GUI;
   * set the timer due time to 10 minutes using the Change() method.
- when the user chooses another city, set the timer due time to 0 so it ticks right away.

The advantage is there will be 10 minutes in between weather operations, so they cannot possibly overlap; and you don't need any synchronization. The disadvantage is you need the Invoke stuff for the GUI.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


modified on Monday, November 16, 2009 2:11 PM

QuestionNullable Rectangle Pin
gwithey16-Nov-09 3:00
gwithey16-Nov-09 3:00 
AnswerRe: Nullable Rectangle Pin
The Man from U.N.C.L.E.16-Nov-09 4:11
The Man from U.N.C.L.E.16-Nov-09 4:11 
QuestionDrawing time instead of numbers in opengl Pin
Paul Harsent16-Nov-09 2:56
Paul Harsent16-Nov-09 2:56 
QuestionHow to selected drowndown list options in web browser Pin
fatix16-Nov-09 2:51
fatix16-Nov-09 2:51 
AnswerRe: How to selected drowndown list options in web browser Pin
Shameel16-Nov-09 3:29
professionalShameel16-Nov-09 3:29 
GeneralRe: How to selected drowndown list options in web browser Pin
fatix16-Nov-09 3:33
fatix16-Nov-09 3:33 
GeneralRe: How to selected drowndown list options in web browser Pin
Shameel16-Nov-09 7:19
professionalShameel16-Nov-09 7:19 
QuestionRe: How to selected drowndown list options in web browser Pin
fatix16-Nov-09 7:38
fatix16-Nov-09 7:38 
AnswerRe: How to selected drowndown list options in web browser Pin
fatix16-Nov-09 12:40
fatix16-Nov-09 12:40 
Questionis there a table cap for MS SQL Compact Edition? [modified] Pin
Emmet_Brown16-Nov-09 1:48
Emmet_Brown16-Nov-09 1:48 
AnswerRe: is there a table cap for MS SQL Compact Edition? Pin
Saksida Bojan16-Nov-09 5:53
Saksida Bojan16-Nov-09 5:53 
Question.Net migration: client hangs [modified] Pin
Helfdane16-Nov-09 1:34
Helfdane16-Nov-09 1:34 
AnswerRe: .Net migration: client hangs Pin
Saksida Bojan16-Nov-09 5:15
Saksida Bojan16-Nov-09 5:15 
GeneralRe: .Net migration: client hangs Pin
Helfdane16-Nov-09 5:21
Helfdane16-Nov-09 5:21 
GeneralRe: .Net migration: client hangs Pin
Saksida Bojan16-Nov-09 5:33
Saksida Bojan16-Nov-09 5:33 
Questioncontext menu on grid Pin
Member 59031015-Nov-09 23:47
Member 59031015-Nov-09 23:47 
AnswerRe: context menu on grid Pin
The Man from U.N.C.L.E.16-Nov-09 2:33
The Man from U.N.C.L.E.16-Nov-09 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.