public OnlineVideos(int priority) { // check if plugin exists otherwise plugin could accidently get added to list string pluginFilename = Path.Combine(Config.GetSubFolder(Config.Dir.Plugins, "Windows"), "OnlineVideos.MediaPortal1.dll"); if (!File.Exists(pluginFilename)) { throw new FileNotFoundException("Plugin not found!"); } else { FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(pluginFilename); string version = fvi.ProductVersion; if (new Version(version) < new Version(0, 31, 0, 0)) { throw new FileLoadException("Plugin does not meet minimum requirements!"); } } TraktLogger.Debug("Adding Hooks to OnlineVideos"); // Subscribe to Player Events ovObject = (GUIOnlineVideos)GUIWindowManager.GetWindow((int)ExternalPluginWindows.OnlineVideos); ovObject.TrackVideoPlayback += new GUIOnlineVideos.TrackVideoPlaybackHandler(TrackVideoPlayback); Priority = priority; }
public OnlineVideos(int priority) { TraktLogger.Info("Initialising OnlineVideos plugin handler"); // check if plugin exists otherwise plugin could accidently get added to list string pluginFilename = Path.Combine(Config.GetSubFolder(Config.Dir.Plugins, "Windows"), "OnlineVideos.MediaPortal1.dll"); if (!File.Exists(pluginFilename)) { throw new FileNotFoundException("Plugin not found!"); } else { var fvi = FileVersionInfo.GetVersionInfo(pluginFilename); if (new Version(fvi.FileVersion) < new Version(1, 9, 0, 3341)) { throw new FileLoadException("Plugin does not meet the minimum requirements, check you have the latest version installed!"); } } TraktLogger.Debug("Adding Hooks to OnlineVideos"); // Subscribe to Player Events ovObject = (GUIOnlineVideos)GUIWindowManager.GetWindow((int)ExternalPluginWindows.OnlineVideos); ovObject.TrackVideoPlayback += new GUIOnlineVideos.TrackVideoPlaybackHandler(TrackVideoPlayback); Priority = priority; }
public void DisposeEvents() { TraktLogger.Debug("Removing Hooks from OnlineVideos"); ovObject.TrackVideoPlayback -= new GUIOnlineVideos.TrackVideoPlaybackHandler(TrackVideoPlayback); ovObject = null; }