Example #1
0
        /// <summary>
        /// Object Hash code
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = CVList != null?CVList.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (AnalysisSoftwareList != null ? AnalysisSoftwareList.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Provider != null ? Provider.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AuditCollection != null ? AuditCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (AnalysisSampleCollection != null ? AnalysisSampleCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (SequenceCollection != null ? SequenceCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (AnalysisCollection != null ? AnalysisCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (AnalysisProtocolCollection != null ? AnalysisProtocolCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DataCollection != null ? DataCollection.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^
                           (BibliographicReferences != null ? BibliographicReferences.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ CreationDate.GetHashCode();
                hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Id != null ? Id.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
                return(hashCode);
            }
        }
Example #2
0
 /// <summary>
 ///     Cascade the identData reference throughout the entire set of objects.
 /// </summary>
 internal void CascadeProperties()
 {
     if (Provider != null)
     {
         Provider.CascadeProperties();
     }
     if (SequenceCollection != null)
     {
         SequenceCollection.CascadeProperties();
     }
     if (AnalysisCollection != null)
     {
         AnalysisCollection.CascadeProperties();
     }
     if (AnalysisProtocolCollection != null)
     {
         AnalysisProtocolCollection.CascadeProperties();
     }
     if (DataCollection != null)
     {
         DataCollection.CascadeProperties();
     }
     if (CVList != null)
     {
         CVList.CascadeProperties();
     }
     if (AnalysisSoftwareList != null)
     {
         AnalysisSoftwareList.CascadeProperties();
     }
     if (AuditCollection != null)
     {
         AuditCollection.CascadeProperties();
     }
     if (AnalysisSampleCollection != null)
     {
         AnalysisSampleCollection.CascadeProperties();
     }
     if (BibliographicReferences != null)
     {
         BibliographicReferences.CascadeProperties();
     }
 }
Example #3
0
 /// <summary>
 ///     Find the <see cref="SampleObj" /> that matches id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 protected internal SampleObj FindSample(string id)
 {
     if (string.IsNullOrWhiteSpace(id))
     {
         return(null);
     }
     try
     {
         var result = AnalysisSampleCollection.Where(item => item.Id == id).ToList();
         if (result.Count > 0)
         {
             return(result.First());
         }
     }
     catch
     {
         // Ignore errors; must resolve reference later...
     }
     return(null);
 }