Skip to content

Instantly share code, notes, and snippets.

import { KittenRoutes } from './kitten-routes';
export class KittenService {
feedKitten(kittenId: number): void {
const url = KittenRoutes.feedKitten(kittenId);
this.http.post(url, {}).subscribe();
}
}
_fileSystemWatcher = new FileSystemWatcher
{
Path = @"C:\My Project\Apps\Analysis",
NotifyFilter = NotifyFilters.LastWrite,
Filter = "*.*"
};
_fileSystemWatcher.EnableRaisingEvents = true;
_fileSystemWatcher.Changed += OnDirectoryChange;
private void OnDirectoryChange(object s, FileSystemEventArgs a)
{
Console.Beep(1500, 200);
}
private readonly Timer _timer = new Timer(300) { AutoReset = false, Enabled = false };
// ...
_timer.Elapsed += (s, a) =>
{
Console.Beep(1500, 200);
_timer.Enabled = false;
};