Exemple #1
0
        static void WatchProcess()
        {
            Action delayedSubscribe = async() =>
            {
                Console.WriteLine("Lync process started");
                await Task.Delay(TimeSpan.FromSeconds(5));

                SubscribeToEvents();
            };

            startupWatcher = ProcessWatcher.OnCreate("lync.exe", delayedSubscribe);

            quitWatcher = ProcessWatcher.OnDelete("lync.exe", () => Console.WriteLine("Lync proess exited"));
        }