-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
30 lines (26 loc) · 939 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using iTunesLib;
namespace iTunesPauser {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main() {
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler( UnhandledException );
iTunesApp application = new iTunesApp();
if( application.PlayerState == ITPlayerState.ITPlayerStateStopped )
application.Play();
else
application.Pause();
}
private static void UnhandledException( Object sender, UnhandledExceptionEventArgs e ) {
// Likely exceptions will stem from the Interop object,
// although given changes in its version there are a
// variety of cryptic causes. Frankly, we're best off
// failing silently and terminating, so our unhandled
// exception goes... largely unhandled.
}
}
}