/// <summary> /// Handles the Click event of the btnSave 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 BtnSaveClick(object sender, EventArgs e) { MovieScraperGroupFactory.SerializeToXml(this.currentScraperGroup); this.cmbScraperGroupList.Properties.TextEditStyle = TextEditStyles.DisableTextEditor; this.btnRefresh.Enabled = this.currentScraperDirty; this.currentScraperDirty = false; }
/// <summary> /// Handles the EditValueChanging event of the cmbScraperGroupList control. /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="DevExpress.XtraEditors.Controls.ChangingEventArgs"/> instance containing the event data. /// </param> private void CmbScraperGroupListEditValueChanging(object sender, ChangingEventArgs e) { if (this.currentScraperDirty) { DialogResult result = XtraMessageBox.Show( "Do you wish to save the current scraper group?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { MovieScraperGroupFactory.SerializeToXml(this.currentScraperGroup); this.currentScraperDirty = false; } } }
/// <summary> /// Handles the Click event of the btnOk 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 BtnOkClick(object sender, EventArgs e) { if (this.currentScraperDirty) { DialogResult result = XtraMessageBox.Show( "Do you wish to save the current scraper first?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { MovieScraperGroupFactory.SerializeToXml(this.currentScraperGroup); } } this.Close(); }
/// <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; } }