timer

wpf mvvm threading.Timer and TimerCallback problems

℡╲_俬逩灬. 提交于 2019-12-25 00:42:26
问题 I have a WPF application developed against the MVVM framework in which the ViewModel constructor set a Timer with a TimerCallback. The TimerCallback retrieves an ObservableCollection and passes it to a field on the VM. I have a CollectionViewSource which has its Source property set to the ObservableCollection. I am using a CollectionViewSource because I want to enable filtering on the Collection. I have found that when the TimerCallback attempts to pass the ObservableCollection into the local

How to get output from ffmpeg process in c#

≡放荡痞女 提交于 2019-12-25 00:25:56
问题 In the code I written in WPF, I run some filter in FFmpeg, If I run the command in terminal (PowerShell or cmd prompt) It will give me information line by line what's going on. I am calling the process from C# code and it's work fine. The problem I have with my code is actually I am not able to get any output from the process I run. I have tried some answers from StackOverflow for FFmpeg process. I see 2 opportunities in my code. I can either fix it by Timer approach or secondly hook an event

How to keep timer running when alert is displayed in javascript

百般思念 提交于 2019-12-25 00:07:04
问题 I am having a Javascript function which displays timer. Now,when timer reaches 2 minutes, I want to display a alert and continue my timer function. But,my timer function stops till user clicks 'Ok' and then resumes from 1:59 secs. Can anyone tell me how to keep the timer function running while popup box is displayed? Here's my function to display timer. var minutes=5; var seconds=59; function time_display(){ if(minutes==2 && seconds==0){ setTimeout('display_time_alert_two_minutes_left()',100)

System.Timers.Timer freezes when UI thread freezes in Windows XP

孤街浪徒 提交于 2019-12-24 22:49:36
问题 Hello. You most likely are aware that a System.Windows.Forms.Timer freezes its action when the user interface thread also freezes, that happens because they run in the same thread. That forced me to use a System.Timers.Timer which in turn if the user interface freezes the Timer continues to run its usual process like nothing ever happen. Well my application does a allot of work with IE, and from time to time IE freezes when browsing a website with bad Javascript code. In consequence that also

display the difference in Days, Hours, Minutes and Seconds with it then updating in realtime?

放肆的年华 提交于 2019-12-24 22:32:21
问题 I am a noob... I have QuitTime.text = quitDate; Which is a date in the past... How can I display the difference in Days, Hours, Minutes and Seconds with it then updating in realtime? 回答1: You can use NSDateComponents NSDate *currentDate = [NSDate date]; NSCalendar *gregorian = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]autorelease]; NSUInteger unitFlags = NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;

Getting NDEF message from tag freezes Android app

情到浓时终转凉″ 提交于 2019-12-24 20:48:19
问题 I'm trying to read an NDEF message from an NFC tag. The detection of the tag works correctly. For reading the NDEF data from the tag I'm running a TimerTask. The task polls the NDEF message from the tag with getNdefMessage() every 900 ms and updates the UI. The procedure works perfect until I remove the phone. Than the app freezes without a logcat error message. Does anyone have an idea why this happens? package com.example.infcdemo; import java.io.IOException; import java.util.Timer; import

Adding a timer to a Xamarin app (c#)

∥☆過路亽.° 提交于 2019-12-24 19:08:52
问题 so i need to have a timer to count down from 60 seconds. I am new to Xamarin and have no idea what it accepts. Any suggestions on how to start? it will be used in android can you use System.Timers.Timer? 回答1: You can use the System.Threading.Timer class, which is documented in the Xamarin docs: https://developer.xamarin.com/api/type/System.Threading.Timer/ Alternatively, for Xamarin.Forms, you have access to a cross-platform Timer via the Device class: Device.StartTimer(TimeSpan.FromSeconds(1

Problems with using QTimer

一笑奈何 提交于 2019-12-24 17:25:02
问题 I am having a small problem with QTimer . Whenever I use QTimer it shows me this error QTimer *timer = new QTimer(); error: invalid use of incomplete type 'struct QTimer' So I tried this QTimer timer(); Now I got rid of that error but when I use members inside the QTimer it shows me these errors. For example timer.start(1000); or timer->start(1000); error: request for member 'start' in 'timer', which is of non-class type 'QTimer*()' I tried to include QTimer but it shows me that there is no

Run System.Timers.Timer event on specific day and time each week c# [duplicate]

安稳与你 提交于 2019-12-24 17:20:04
问题 This question already has answers here : How to call a method daily, at specific time, in C#? (16 answers) Closed 6 years ago . I'm in the process of writing a windows service using System.Timers.Timer to keep track of my interval. What I'd like to do is make it so my service will launch on a specific day and time based on variables in my app.config file. 回答1: I don't think you're really writing a Windows service, I think you're writing a job. A cleaner, and easier approach, to your problem

Thread.sleep() to swing Timer conversion

荒凉一梦 提交于 2019-12-24 17:20:02
问题 I am trying to implement a Thread.sleep(6000) line but it seems to freeze in the applet. When I tried to use Timers, I wasn't sure how to use because I am not very good with event listeners. I am basically trying to call a method fetchUrl() every 6 seconds, after the user clicks the enter button. How can I implement this? public void init() { c = getContentPane(); c.setLayout(flow); c.setBackground(forum); question.setForeground(Color.white); question.setFont(tnr); question2.setForeground