/// <summary> /// Updates the listview sub-item. /// </summary> /// <param name="order"></param> /// <param name="item"></param> /// <param name="column"></param> private void SetColumn(ResearchPoint researchPoint, ListViewItem.ListViewSubItem item, ResearchColumn column) { switch (column) { case ResearchColumn.Agent: item.Text = researchPoint.AgentName; break; case ResearchColumn.Level: item.Text = researchPoint.AgentLevel.ToString(); break; case ResearchColumn.Quality: item.Text = researchPoint.AgentQuality.ToString(); break; case ResearchColumn.Field: item.Text = researchPoint.Field; break; case ResearchColumn.CurrentRP: item.Text = researchPoint.CurrentRP.ToString("N2"); break; case ResearchColumn.PointsPerDay: item.Text = researchPoint.PointsPerDay.ToString("N2"); break; case ResearchColumn.StartDate: item.Text = researchPoint.StartDate.ToLocalTime().ToString(); break; case ResearchColumn.Location: item.Text = researchPoint.Station.FullLocation; break; case ResearchColumn.Region: item.Text = researchPoint.Station.SolarSystem.Constellation.Region.Name; break; case ResearchColumn.SolarSystem: item.Text = researchPoint.Station.SolarSystem.Name; break; case ResearchColumn.Station: item.Text = researchPoint.Station.Name; break; default: //return; throw new NotImplementedException(); } }
/// <summary> /// Checks the given text matches the item. /// </summary> /// <param name="x">The x.</param> /// <param name="text">The text.</param> /// <returns> /// <c>true</c> if [is text matching] [the specified x]; otherwise, <c>false</c>. /// </returns> private bool IsTextMatching(ResearchPoint x, string text) { if (String.IsNullOrEmpty(text) || x.AgentName.ToLowerInvariant().Contains(text) || x.Field.ToLowerInvariant().Contains(text) || x.Station.Name.ToLowerInvariant().Contains(text) || x.Station.SolarSystem.Name.ToLowerInvariant().Contains(text) || x.Station.SolarSystem.Constellation.Name.ToLowerInvariant().Contains(text) || x.Station.SolarSystem.Constellation.Region.Name.ToLowerInvariant().Contains(text)) return true; return false; }