internal void Start()
 {
     try
       {
     Utils.DelayStop = new Hashtable();
     Utils.SetIsStopping(false);
     //
     InitLogger();
     //
     logger.Info("Fanart Handler is starting.");
     logger.Info("Fanart Handler version is " + Utils.GetAllVersionNumber());
     //
     Translation.Init();
     SetupConfigFile();
     Utils.InitFolders();
     Utils.LoadSettings();
     //
     FPlay = new FanartPlaying();
     FPlayOther = new FanartPlayOther();
     FSelected = new FanartSelected();
     FSelectedOther = new FanartSelectedOther();
     FRandom = new FanartRandom();
     //
     SetupWindowsUsingFanartHandlerVisibility();
     SetupVariables();
     Utils.SetupDirectories();
     //
     logger.Debug("Default Backdrops [" + Utils.UseDefaultBackdrop + " - " + Utils.DefaultBackdropMask+"] for Music" + (Utils.DefaultBackdropIsImage ? ":"+Utils.DefaultBackdrop : "."));
     if (Utils.DefaultBackdropIsImage)
     {
       Utils.DefaultBackdropImages.Add(0, new FanartImage("", "", Utils.DefaultBackdrop, "", "", ""));
     }
     else
     {
       if (Utils.UseDefaultBackdrop)
       {
     if (!Utils.GetIsStopping() && SyncPointDefaultBackdrops == 0)
     {
       MyDefaultBackdropWorker = new DefaultBackdropWorker();
       MyDefaultBackdropWorker.ProgressChanged += new ProgressChangedEventHandler(MyDefaultBackdropWorker.OnProgressChanged);
       MyDefaultBackdropWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(MyDefaultBackdropWorker.OnRunWorkerCompleted);
       MyDefaultBackdropWorker.RunWorkerAsync();
     }
       }
     }
     logger.Debug("MyPictures SlideShow: "+Utils.Check(Utils.UseMyPicturesSlideShow));
     if (Utils.UseMyPicturesSlideShow)
     {
       if (!Utils.GetIsStopping() && SyncPointPictures == 0)
       {
     MyPicturesWorker = new PicturesWorker();
     MyPicturesWorker.ProgressChanged += new ProgressChangedEventHandler(MyPicturesWorker.OnProgressChanged);
     MyPicturesWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(MyPicturesWorker.OnRunWorkerCompleted);
     MyPicturesWorker.RunWorkerAsync();
       }
     }
     //
     logger.Debug("FanartHandler skin use: " + Utils.Check(FPlayOther.WindowsUsingFanartPlayClearArt.Count > 0) + " Play ClearArt, " +
                                           Utils.Check(FPlayOther.WindowsUsingFanartPlayGenre.Count > 0) + " Play Genres");
     logger.Debug("                        " + Utils.Check(FSelectedOther.WindowsUsingFanartSelectedClearArtMusic.Count > 0) + " Selected Music ClearArt, " +
                                           Utils.Check(FSelectedOther.WindowsUsingFanartSelectedGenreMusic.Count > 0) + " Selected Music Genres");
     logger.Debug("                        " + Utils.Check(FSelectedOther.WindowsUsingFanartSelectedStudioMovie.Count > 0) + " Selected Movie Studios, " +
                                           Utils.Check(FSelectedOther.WindowsUsingFanartSelectedGenreMovie.Count > 0) + " Selected Movie Genres, " +
                                           Utils.Check(FSelectedOther.WindowsUsingFanartSelectedAwardMovie.Count > 0) + " Selected Movie Awards");
     //
     Utils.InitiateDbm("mediaportal");
     Utils.StopScraper = false;
     //
     AddToDirectoryTimerQueue("All");
     //
     SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(OnSystemPowerModeChanged);
     //
     GUIWindowManager.OnActivateWindow += new GUIWindowManager.WindowActivationHandler(GuiWindowManagerOnActivateWindow);
     GUIWindowManager.Receivers += new SendMessageHandler(GUIWindowManager_OnNewMessage);
     //
     g_Player.PlayBackStarted += new g_Player.StartedHandler(OnPlayBackStarted);
     g_Player.PlayBackEnded += new g_Player.EndedHandler(OnPlayBackEnded);
     //
     refreshTimer = new Timer();
     refreshTimer.Interval = Utils.RefreshTimerInterval;
     refreshTimer.Elapsed += new ElapsedEventHandler(UpdateImageTimer);
     //
     if (Utils.ScraperMPDatabase)
     {
       myScraperTimer = new TimerCallback(UpdateScraperTimer);
       scraperTimer = new System.Threading.Timer(myScraperTimer, null, 1000, Utils.ScrapperTimerInterval);
     }
     //
     InitFileWatcher();
     try
     {
       UtilsMovingPictures.SetupMovingPicturesLatest();
     }
     catch { }
     //
     try
     {
       UtilsTVSeries.SetupTVSeriesLatest();
     }
     catch { }
     //
     ClearCurrProperties();
     EmptyAllProperties();
     HideScraperProgressIndicator();
     HideDummyControls();
     InitRandomProperties();
     //
     logger.Info("Fanart Handler is started.");
     logger.Debug("Current Culture: {0}", CultureInfo.CurrentCulture.Name);
       }
       catch (Exception ex)
       {
     logger.Error("Start: " + ex);
       }
       Utils.iActiveWindow = GUIWindowManager.ActiveWindow;
 }
        private void StopTasks(bool suspending)
        {
            try
              {
            Utils.SetIsStopping(true);
            if (Utils.GetDbm() != null)
              Utils.StopScraper = true;

            try
            {
              UtilsMovingPictures.DisposeMovingPicturesLatest();
            }
            catch { }
            try
            {
              UtilsTVSeries.DisposeTVSeriesLatest();
            }
            catch { }

            // ISSUE: method pointer
            GUIWindowManager.OnActivateWindow -= new GUIWindowManager.WindowActivationHandler(GuiWindowManagerOnActivateWindow);
            GUIWindowManager.Receivers -= new SendMessageHandler(GUIWindowManager_OnNewMessage);
            g_Player.PlayBackStarted -= new g_Player.StartedHandler(OnPlayBackStarted);
            g_Player.PlayBackEnded -= new g_Player.EndedHandler(OnPlayBackEnded);

            var num = 0;
            while (Utils.GetDelayStop() && num < 20)
            {
              Utils.ThreadToLongSleep();
              checked { ++num; }
            }

            StopScraperNowPlaying();
            if (MyFileWatcher != null)
            {
              MyFileWatcher.Created -= new FileSystemEventHandler(MyFileWatcher_Created);
              MyFileWatcher.Dispose();
            }
            if (scraperTimer != null)
            {
              scraperTimer.Dispose();
            }
            if (refreshTimer != null)
            {
              refreshTimer.Stop();
              refreshTimer.Dispose();
            }
            if (MyScraperWorker != null)
            {
              MyScraperWorker.CancelAsync();
              MyScraperWorker.Dispose();
            }
            if (MyScraperNowWorker != null)
            {
              MyScraperNowWorker.CancelAsync();
              MyScraperNowWorker.Dispose();
            }
            if (MyDirectoryWorker != null)
            {
              MyDirectoryWorker.CancelAsync();
              MyDirectoryWorker.Dispose();
            }
            if (MyRefreshWorker != null)
            {
              MyRefreshWorker.CancelAsync();
              MyRefreshWorker.Dispose();
            }
            if (MyPicturesWorker != null)
            {
              MyPicturesWorker.CancelAsync();
              MyPicturesWorker.Dispose();
            }
            if (MyDefaultBackdropWorker != null)
            {
              MyDefaultBackdropWorker.CancelAsync();
              MyDefaultBackdropWorker.Dispose();
            }
            if (Utils.GetDbm() != null)
              Utils.GetDbm().Close();

            if (FPlay != null)
              FPlay.EmptyAllPlayImages();
            if (FSelected != null)
              FSelected.EmptyAllSelectedImages();
            if (FRandom != null)
            {
              FRandom.EmptyAllRandomImages();
              FRandom.ClearPropertiesRandom();
            }
            Logos.ClearDynLogos();
            //
            if (!suspending)
            {
              SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(OnSystemPowerModeChanged);
            }
            //
            Utils.BadArtistsList = null;
            Utils.MyPicturesSlideShowFolders = null;
            Utils.Genres = null;
            Utils.Characters = null;
            Utils.Studios = null;
            Utils.AwardsList = null;
            //
            FPlay = null;
            FPlayOther = null;
            FSelected = null;
            FSelectedOther = null;
            FRandom = null;
            //
            Utils.DelayStop = new Hashtable();
              }
              catch (Exception ex)
              {
            logger.Error("Stop: " + ex);
              }
        }