コード例 #1
0
ファイル: App.xaml.cs プロジェクト: yyss09yy/NowPlayingV2
        protected override void OnStartup(StartupEventArgs e)
        {
            var isDebugMode = false;
            var args        = Environment.GetCommandLineArgs();

            if (args.Length > 1 && args[1] == "--debug")
            {
                isDebugMode = true;
            }
#if DEBUG
            isDebugMode = true;
            if (Debugger.IsAttached)
            {
                isDebugMode = false;
            }
#endif
            if (isDebugMode)
            {
                Win32API.AllocConsole();
                Console.WriteLine("[DEBUG]Debug mode enabled.");
                Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
            }
            Trace.WriteLine("[DEBUG]Application Start.");
            ITunesWatcher.CreateWatcherTask();
            base.OnStartup(e);
        }
コード例 #2
0
 private void OnQuittingEvent()
 {
     isITunesInitialized = false;
     //wait until itunes exits.
     while (true)
     {
         if (!Process.GetProcessesByName("iTunes").Any())
         {
             Trace.WriteLine("[DEBUG]itunes quit ok.");
             ITunesWatcher.CreateWatcherTask();
             return;
         }
         Thread.Sleep(1000);
     }
 }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: inazu01/NowPlayingV2
 protected override void OnStartup(StartupEventArgs e)
 {
     ITunesWatcher.CreateWatcherTask();
     base.OnStartup(e);
 }