WYZTracker/Program.cs
/// <summary>
/// The main entry point for the application.
/// </summary>
The main entry point for the application.
The main entry point for the application .
[STAThread]
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += 
                new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            bool audioInitialized = PlaybackStreamer.IsAudioAvailable();
            if (!audioInitialized)
            {
                bool installed = installOpenAL();
                if (installed)
                {
                    Restart(string.Empty);
                }
            }
            if (audioInitialized)
            {
                try
                {
                    if (args.Length > 1)
                    {
                        startSeveralInstances(args);
                    }
                    else
                    {
                        startSingleInstance(args);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(ex.ToString());
                    string errorMessage = string.Format(WYZTracker.Properties.Resources.ApplicationError, Logger.LogPath);
                    MessageBox.Show(errorMessage,
                        WYZTracker.Properties.Resources.Error,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    if (audioInitialized)
                    {
                        PlaybackStreamer.StopAudio();
                    }
                }
            }
            VirtualPiano.ReleaseDevices();
            Application.Exit();
        }
[ STAThread ] static void Main ( string [ ] args ) { AppDomain . CurrentDomain . UnhandledException += new UnhandledExceptionEventHandler ( CurrentDomain_UnhandledException ) ; bool audioInitialized = PlaybackStreamer . IsAudioAvailable ( ) ; if ( ! audioInitialized ) { bool installed = installOpenAL ( ) ; if ( installed ) { Restart ( string . Empty ) ; } } if ( audioInitialized ) { try { if ( args . Length > 1 ) { startSeveralInstances ( args ) ; } else { startSingleInstance ( args ) ; } } catch ( Exception ex ) { Logger . Log ( ex . ToString ( ) ) ; string errorMessage = string . Format ( WYZTracker . Properties . Resources . ApplicationError , Logger . LogPath ) ; MessageBox . Show ( errorMessage , WYZTracker . Properties . Resources . Error , MessageBoxButtons . OK , MessageBoxIcon . Error ) ; if ( audioInitialized ) { PlaybackStreamer . StopAudio ( ) ; } } } VirtualPiano . ReleaseDevices ( ) ; Application . Exit ( ) ; }
The main entry point for the application.
The main entry point for the application .
args
string[]