public LocalPlaylists(IHelper aHelper, bool aAddOptionPage) { iLock = new object(); iOptionSaveDirectory = new OptionFolderPath("playlistpath", "Local playlist path", "Path where local playlists are saved", Path.Combine(aHelper.DataPath.FullName, "Playlists")); if (aAddOptionPage) { // create the options page OptionPage optionPage = new OptionPage("Local Playlists"); optionPage.Add(iOptionSaveDirectory); aHelper.AddOptionPage(optionPage); } else { aHelper.AddOption(iOptionSaveDirectory); } // listen for changes to the save directory option iOptionSaveDirectory.EventValueChanged += SaveDirectoryChanged; // initialise as being in its error state iPlaylists = null; iWrapped = new LocalPlaylistsRootError(kRootId); iWrapped.EventContentUpdated += ContentUpdated; iWrapped.EventContentAdded += ContentAdded; iWrapped.EventContentRemoved += ContentRemoved; Refresh(); }
private void Initialise(IHelper aHelper, IViewAutoUpdate aView, IInvoker aInvoker, EventHandler <EventArgs> aUpdateStarted) { // create the auto updater // set it to look for stable releases to start with // option page will event what releases to look for once saved option has been parsed iAutoUpdate = new AutoUpdate(aHelper, AutoUpdate.kDefaultFeedLocation, 1000 * 60 * 60, AutoUpdate.EUpdateType.Stable, 1); // create the option page iOptionPageUpdates = new OptionPageUpdates(aHelper); iOptionPageUpdates.EventChanged += OptionPageUpdatesChanged; aHelper.AddOptionPage(iOptionPageUpdates); // create the controller iAutoUpdateController = new AutoUpdateController(aHelper, iAutoUpdate, iOptionPageUpdates, aView, aInvoker); iAutoUpdateController.EventUpdateStarted += aUpdateStarted; }