public void Load()
        {
            try
            {
                thumbManager = new ThumbnailManager();
                smf.MediaOpened += smf_MediaOpened;
                smf.PlaylistItemChanged += smf_PlaylistItemChanged;
                smf.PlayRateChanged += smf_PlayRateChanged;
                smf.BufferingProgressChanged += smf_BufferingProgressChanged;
                smf.MediaTransport.ThumbnailRequest += MediaTransport_ThumbnailRequest;

                ReportIfError(() => smf.GlobalConfigMetadata.FirstOrDefault(c => c.Key == MetaDataItemMaxCacheSize).IfNotNull(m => thumbManager.MaxCacheSize = int.Parse(m.Value.ToString())));
                ReportIfError(() => smf.GlobalConfigMetadata.FirstOrDefault(c => c.Key == MetaDataItemMaxSimultaneousRequests).IfNotNull(m => thumbManager.MaxSimultaneousRequests = int.Parse(m.Value.ToString())));
                ReportIfError(() => smf.GlobalConfigMetadata.FirstOrDefault(c => c.Key == MetaDataItemPredictionInterval).IfNotNull(m => thumbManager.PredictionInterval = TimeSpan.Parse(m.Value.ToString())));
                ReportIfError(() => smf.GlobalConfigMetadata.FirstOrDefault(c => c.Key == MetaDataItemThumbnailRequestDelay).IfNotNull(m => thumbManager.ThumbnailRequestDelay = TimeSpan.Parse(m.Value.ToString())));
                ReportIfError(() => smf.GlobalConfigMetadata.FirstOrDefault(c => c.Key == MetaDataItemPermanentCacheSize).IfNotNull(m => thumbManager.PermanentCacheSize = int.Parse(m.Value.ToString())));
                thumbManager.LoadThumbnailAsync += thumbManager_LoadThumbnailAsync;
                thumbManager.ShowThumbnail += thumbManager_ShowImage;

                IsLoaded = true;
                PluginLoaded.IfNotNull(p => p(this));
            }
            catch (Exception ex)
            {
                PluginLoadFailed.IfNotNull(p => p(this, ex));
            }
        }
        public void Unload()
        {
            try
            {
                smf.MediaOpened -= smf_MediaOpened;
                smf.PlaylistItemChanged -= smf_PlaylistItemChanged;
                smf.PlayRateChanged -= smf_PlayRateChanged;
                smf.BufferingProgressChanged -= smf_BufferingProgressChanged;
                smf.MediaTransport.ThumbnailRequest -= MediaTransport_ThumbnailRequest;
                smf = null;

                thumbManager.LoadThumbnailAsync -= thumbManager_LoadThumbnailAsync;
                thumbManager.ShowThumbnail -= thumbManager_ShowImage;
                thumbManager = null;

                IsLoaded = false;
                PluginUnloaded.IfNotNull(p => p(this));
            }
            catch (Exception ex)
            {
                PluginUnloadFailed.IfNotNull(p => p(this, ex));
            }
        }