In my WPF application one of the assumptions is watching a folder to capture changes.
My first idea is:
DispatcherTimer dt = new DispatcherTimer();
dt.Tick += (senderTick, eTick) =>
{
// do observable folder
};
dt.Interval = new TimeSpan(0, 0, 1);
dt.Start();
The example works but I do not know if it is the best solution. My other idea is use Reactive Extenison
var timer = Observable.Interval(Timespan.FromMilliseconds(1000));
timer.Subscribe(tick => OnSomeCondition());
However, I am not convinced. Maybe there are better spoosby? Maybe it would be a good idea to write a separate application as a Windows service that would do it anyway.