File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
CefSharp.WinForms.Example/Handlers Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -29,26 +29,18 @@ public WinFormsBrowserProcessHandler(TaskScheduler scheduler)
2929
3030 private void TimerTick ( object sender , EventArgs e )
3131 {
32- //Reset the timer interval to maximum
33- timer . Interval = MaxTimerDelay ;
34-
32+ //Basically execute Cef.DoMessageLoopWork 30 times per second
3533 //Execute DoMessageLoopWork on UI thread
3634 factory . StartNew ( ( ) => Cef . DoMessageLoopWork ( ) ) ;
3735 }
3836
3937 protected override void OnScheduleMessagePumpWork ( int delay )
4038 {
41- //Basically execute Cef.DoMessageLoopWork 30 times per second,
42- //when delay <= 0 set the timer interval to really small so it's executed
43- // relatively quickly.
39+ //when delay <= 0 queue the Task up for execution on the UI thread.
4440 if ( delay <= 0 )
4541 {
4642 //Update the timer to execute almost immediately
47- timer . Interval = 1 ;
48- }
49- else
50- {
51- timer . Interval = delay ;
43+ factory . StartNew ( ( ) => Cef . DoMessageLoopWork ( ) ) ;
5244 }
5345 }
5446
You can’t perform that action at this time.
0 commit comments