internal static void RunSubscribeDialog()
        {
            PodcastSubscribeDialog subscribe_dialog = new PodcastSubscribeDialog();

            ResponseType response = (ResponseType)subscribe_dialog.Run();

            subscribe_dialog.Destroy();

            if (response == ResponseType.Ok)
            {
                Uri feedUri = null;

                if (subscribe_dialog.Url == String.Empty)
                {
                    return;
                }

                string         url  = subscribe_dialog.Url.Trim('/').Trim();
                SyncPreference sync = subscribe_dialog.SyncPreference;

                try
                {
                    // CreateUri should be in PodcastFeedInfo
                    feedUri = PodcastFeedFetcher.CreateUri(url);
                    SubscribeToPodcastFeed(feedUri.ToString(), sync);
                }
                catch (NotSupportedException)
                {
                    HigMessageDialog.RunHigMessageDialog(
                        null,
                        DialogFlags.Modal,
                        MessageType.Warning,
                        ButtonsType.Ok,
                        Catalog.GetString("Uri Scheme Not Supported"),
                        Catalog.GetString("Podcast feed URI scheme is not supported.")
                        );

                    return;
                }
                catch {
                    HigMessageDialog.RunHigMessageDialog(
                        null,
                        DialogFlags.Modal,
                        MessageType.Warning,
                        ButtonsType.Ok,
                        Catalog.GetString("Invalid URL"),
                        Catalog.GetString("Podcast feed URL is invalid.")
                        );

                    return;
                }
            }
        }
        internal static void Initialize(PodcastPlugin plugin)
        {
            lock (init_sync)
            {
                if (initializing || initialized)
                {
                    return;
                }

                disposed     = false;
                initializing = true;
            }

            DownloadCore.Initialize();
            DownloadCore.MaxDownloads = 2;

            DownloadCore.DownloadCompleted   += OnDownloadCompletedHandler;
            DownloadCore.DownloadTaskStarted += OnDownloadTaskStartedHandler;
            DownloadCore.DownloadTaskStopped += OnDownloadTaskStoppedHandler;

            DownloadCore.DownloadDropped    += OnDownloadDroppedHandler;
            DownloadCore.DownloadRegistered += OnDownloadRegisteredHandler;
            DownloadCore.RegistrationFailed += OnRegistrationFailedHandler;

            downloads = new Hashtable();

            Library     = new PodcastLibrary();
            FeedFetcher = new PodcastFeedFetcher();

            Plugin = plugin;

            PodcastDBManager.InitPodcastDatabase();

            ServicePointManager.CertificatePolicy = new PodcastCertificatePolicy();

            if (Globals.Library.IsLoaded)
            {
                LoadFromDatabase();
            }
            else
            {
                Globals.Library.Reloaded += OnLibraryReloaded;
            }
        }
        internal static void Initialize(PodcastPlugin plugin)
        {
            lock (init_sync)
            {
                if (initializing || initialized)
                {
                    return;
                }

                disposed = false;
                initializing = true;
            }

            DownloadCore.Initialize ();
            DownloadCore.MaxDownloads = 2;

            DownloadCore.DownloadCompleted += OnDownloadCompletedHandler;
            DownloadCore.DownloadTaskStarted += OnDownloadTaskStartedHandler;
            DownloadCore.DownloadTaskStopped += OnDownloadTaskStoppedHandler;

            DownloadCore.DownloadDropped += OnDownloadDroppedHandler;
            DownloadCore.DownloadRegistered += OnDownloadRegisteredHandler;
            DownloadCore.RegistrationFailed += OnRegistrationFailedHandler;

            downloads = new Hashtable ();

            Library = new PodcastLibrary ();
            FeedFetcher = new PodcastFeedFetcher ();

            Plugin = plugin;

            PodcastDBManager.InitPodcastDatabase ();

            ServicePointManager.CertificatePolicy = new PodcastCertificatePolicy ();

            if(Globals.Library.IsLoaded)
            {
                LoadFromDatabase ();
            }
            else
            {
                Globals.Library.Reloaded += OnLibraryReloaded;
            }
        }