private void Requery() { UpdateCohortCombo(); if (string.IsNullOrEmpty(Peptide)) { Text = TabText = "Half Life: " + ProteinName.Substring(0, Math.Min(20, ProteinName.Length)); } else { Text = TabText = "Half Life: " + Peptide; } if (!IsHandleCreated) { return; } dataGridView1.Rows.Clear(); RequeryPeptideAnalyses(); foreach (var peptideAnalysis in _peptideAnalyses) { peptideAnalysis.EnsurePeaksCalculated(); tbxProteinDescription.Text = peptideAnalysis.Peptide.ProteinDescription; foreach (var peptideFileAnalysis in peptideAnalysis.GetFileAnalyses(false)) { var row = dataGridView1.Rows[dataGridView1.Rows.Add()]; row.Tag = peptideFileAnalysis; } } UpdateRows(true); }
/// <summary> /// Comparison /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(ProteinInformation other) { if (other == null) { return(false); } return(ProteinName.Equals(other.ProteinName)); }
/// <summary> /// Overloaded comparison /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj == null) { return(false); } var objAsProt = obj as ProteinInformation; if (objAsProt == null) { return(false); } return(ProteinName.Equals(objAsProt.ProteinName)); }
public override int GetHashCode() { return(ProteinName != null ? ProteinName.GetHashCode() : 0); }