private void BtnAdd_Click(object sender, EventArgs e) { var d = new LocationBase { Kind = LocationBaseKind.Local, Name = "" }; LVLocations.AddObject(d); }
public Locations() { InitializeComponent(); var locations = LocationPersistence.ListBases(); LVLocations.VirtualMode = false; LVLocations.SetObjects(locations); }
private void BtnRemoveLocation_Click(object sender, EventArgs e) { if (m_images == null || CheckForChanges()) { return; } var location = LVLocations.SelectedObject as LocationForDisplay; if (m_imageIndex >= m_images.Count) { return; } if (MessageBox.Show("Are you sure you want to delete " + location.LocationBase + ">" + location.LocationData + " location ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { location.Delete(); LVLocations.RemoveObject(location); } }
private void DisplayTitleInfo(Title title) { m_currentTitle = title; LVLocations.ClearObjects(); LVRatings.ClearObjects(); m_imageIndex = 0; if (title != null) { TbxReleaseYear.Text = title.Year.ToString("##"); TbxDescription.Text = title.Description; TbxImdbId.Text = title.ImdbId; TbxSeason.Text = title.Season.ToString("##"); TbxDisk.Text = title.Disk.ToString("##"); TbxEpisode.Text = title.EpisodeOrTrack.ToString("##"); TbxTitleName.Text = title.TitleName; CbxKind.SetSelectedKey(title.Kind); LVLocations.AddObjects(LocationPersistence.ListTitleLocations(title.Id)); LVRatings.AddObjects(TitlePersistence.GetRatings(title.Id)); SetEpisodeControlsState(m_currentTitle.Kind); m_images = MediaSamplePersistence.GetSamples(title.Id, MediaSampleKind.Image); DisplayImage(); } else { TbxReleaseYear.Text = ""; TbxDescription.Text = ""; TbxImdbId.Text = ""; TbxSeason.Text = ""; TbxDisk.Text = ""; TbxEpisode.Text = ""; TbxTitleName.Text = ""; CbxKind.SelectedIndex = -1; SetEpisodeControlsState(TitleKind.Title); m_images = null; SetImageNavigationControls(); PbxImage.Clear(); } }