/// <summary> /// Deletes the infomation from the Survey /// </summary> /// <param name="sighting">This is the Sighting that will be Deleted</param> public void DeleteSighting(Sighting sighting) { var oldSighting = Sightings.Find(t => t.Id == sighting.Id); Sightings.Remove(oldSighting); NavigationController.PopViewController(true); }
/// <summary> /// Passes the relevent infomation about the Survey input to be edited /// </summary> /// <param name="editsighting">This is the Sighting that will be Deleted</param> public void EditSighting(Sighting editsighting) { var detail = Storyboard.InstantiateViewController("detail") as SightingDetailController; detail.SetSighting(this, editsighting); NavigationController.PushViewController(detail, true); }
/// <summary> /// Creates a Sighting before pushing new window to edit the newly created survey /// </summary> public void CreateSighting() { int newId = 0; if (Sightings.Count != 0) { newId = Sightings[Sightings.Count - 1].Id + 1; } var newsighting = new Sighting(newId); Sightings.Add(newsighting); var detail = Storyboard.InstantiateViewController("detail") as SightingDetailController; detail.SetSighting(this, newsighting); NavigationController.PushViewController(detail, true); }
/// <summary> /// Sets the interaction between the parent screen and the currently selected item /// </summary> /// <param name="d">The part Bird screen Controller</param> /// <param name="s">the current Sighting</param> public void SetSighting(BirdScreenController d, Sighting s) { Delegate = d; currentSighting = s; }
/// <summary> /// saves the infomation from the Survey /// </summary> /// <param name="sighting">This is the Sighting that will be saved</param> public void SaveSighting(Sighting sighting) { var oldSighting = Sightings.Find(t => t.Id == sighting.Id); NavigationController.PopViewController(true); }