private bool IncidentFilter(object item) { try { Logging.LogMethodCall(MethodBase.GetCurrentMethod().DeclaringType.Name, () => new Dictionary <String, Object> { { nameof(item), item } }); IncidentViewModel incident = item as IncidentViewModel; if (incident == null) { return(false); } return(!CallTypeViewModel.HiddenCallTypes.Contains(incident.CallType)); } catch (Exception ex) { var message = "Error filtering incident"; ErrorHelper.OnError(MethodBase.GetCurrentMethod().DeclaringType.Name, message, ex); Logging.LogMessage(Logging.LogType.Error, message, ex); return(false); } }
public void IncidentToggle(IncidentViewModel incident) { try { Logging.LogMethodCall(MethodBase.GetCurrentMethod().DeclaringType.Name, () => new Dictionary <String, Object> { { nameof(incident), incident } }); var selected = Incidents.Where(incdnt => incdnt.Selected); foreach (var incdnt in selected) { incdnt.Selected = false; if (incident == null || incdnt.UniqueID == incident.UniqueID) { incident = null; } } if (incident != null) { incident.Selected = true; if (incident.UnGeocoded) { return; } MainView.ZoomTo(new Point { Latitude = incident.Latitude, Longitude = incident.Longitude }); } } catch (Exception ex) { var message = "Error toggling incident"; ErrorHelper.OnError(MethodBase.GetCurrentMethod().DeclaringType.Name, message, ex); Logging.LogMessage(Logging.LogType.Error, message, ex); } }
public void IncidentRouteTo(IncidentViewModel incident) { try { Logging.LogMethodCall(MethodBase.GetCurrentMethod().DeclaringType.Name, () => new Dictionary <String, Object> { { nameof(incident), incident } }); if (incident.UnGeocoded) { return; } MainView.RouteTo(new Point { Latitude = incident.Latitude, Longitude = incident.Longitude }); } catch (Exception ex) { var message = "Error routing to incident"; ErrorHelper.OnError(MethodBase.GetCurrentMethod().DeclaringType.Name, message, ex); Logging.LogMessage(Logging.LogType.Error, message, ex); } }