/// <summary> /// Initializes a new instance of the <see cref="FrmScraperGroupManager"/> class. /// </summary> public FrmScraperGroupManager() { this.InitializeComponent(); MovieScraperGroupFactory.GetScraperGroupsOnDisk(this.cmbScraperGroupList); this.SetupInitialDataBindings(); this.SelectFirstScraperGroupEntry(); }
/// <summary> /// Handles the Click event of the btnRemove control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="System.EventArgs"/> instance containing the event data. /// </param> private void BtnRemoveClick(object sender, EventArgs e) { DialogResult result = XtraMessageBox.Show( "Are you sure you wish to delete this scraper group?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { File.Delete( Get.FileSystemPaths.PathDirScraperGroupsMovies + this.currentScraperGroup.ScraperName + ".xml"); MovieScraperGroupFactory.GetScraperGroupsOnDisk(this.cmbScraperGroupList); this.SelectFirstScraperGroupEntry(); } }
/// <summary> /// Handles the BeforePopup event of the popupLoadFromWeb control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="System.ComponentModel.CancelEventArgs"/> instance containing the event data. /// </param> private void popupLoadFromWeb_BeforePopup(object sender, CancelEventArgs e) { this.popupLoadFromWeb.ClearLinks(); var barItemLink = new BarButtonItem( this.barManager1, "Scrape using " + MovieDBFactory.GetCurrentMovie().ScraperGroup); barItemLink.Tag = MovieDBFactory.GetCurrentMovie().ScraperGroup; barItemLink.ItemClick += this.barItemLink_ItemClick; this.popupLoadFromWeb.AddItem(barItemLink); foreach (var scraper in MovieScraperGroupFactory.GetScraperGroupsOnDisk()) { barItemLink = new BarButtonItem(this.barManager1, "Use " + scraper); barItemLink.Tag = MovieDBFactory.GetCurrentMovie().ScraperGroup; barItemLink.ItemClick += this.barItemLink_ItemClick; this.popupLoadFromWeb.AddItem(barItemLink); } }
/// <summary> /// Handles the Click event of the btnAdd control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="System.EventArgs"/> instance containing the event data. /// </param> private void BtnAddClick(object sender, EventArgs e) { var enterAValue = new FrmEnterAValue("Enter a scraper name"); enterAValue.ShowDialog(); if (!enterAValue.Cancelled) { var scraperGroup = new MovieScraperGroupModel { ScraperName = enterAValue.Response }; MovieScraperGroupFactory.SerializeToXml(scraperGroup); MovieScraperGroupFactory.GetScraperGroupsOnDisk(this.cmbScraperGroupList); this.currentScraperGroup = scraperGroup; this.currentScraperGroup = new MovieScraperGroupModel(); this.RefreshDatabindings(); this.cmbScraperGroupList.Text = enterAValue.Response; } }