예제 #1
0
 public bool Equals(IonMobilityLibrary other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && Equals(other._database, _database) && Equals(other.DatabasePath, DatabasePath));
 }
예제 #2
0
 public bool Equals(IonMobilityLibrary other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (!base.Equals(other))
     {
         return(false);
     }
     // N.B. not comparing Status members, which exist only for the benefit of audit logging
     if (!Equals(other.FilePath, FilePath))
     {
         return(false);
     }
     if (!Equals(Count, other.Count))
     {
         return(false);
     }
     if (Count <= 0)
     {
         return(true); // Both not yet in memory
     }
     foreach (var key in _database.DictLibrary.LibKeys)
     {
         if (!other._database.DictLibrary.TryGetValue(key, out var otherValues))
         {
             return(false);
         }
         _database.DictLibrary.TryGetValue(key, out var values);
         if (values.Count != otherValues.Count)
         {
             return(false);
         }
         foreach (var ionMobilityAndCcs in values)
         {
             if (!otherValues.Contains(ionMobilityAndCcs))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
예제 #3
0
 private IonMobilityLibrary LoadIonMobilityLibrary(IDocumentContainer container, IonMobilityLibrary dtLib)
 {
     // TODO: Something better than locking for the entire load
     lock (_loadedIonMobilityeLibraries)
     {
         IonMobilityLibrary libResult;
         if (!_loadedIonMobilityeLibraries.TryGetValue(dtLib.Name, out libResult))
         {
             libResult = (IonMobilityLibrary)dtLib.Initialize(new LoadMonitor(this, container, dtLib));
             if (libResult != null)
             {
                 _loadedIonMobilityeLibraries.Add(libResult.Name, libResult);
             }
         }
         return(libResult);
     }
 }
 private IonMobilityLibrary LoadIonMobilityLibrary(IDocumentContainer container, IonMobilityLibrary dtLib)
 {
     // TODO: Something better than locking for the entire load
     lock (_loadedIonMobilityeLibraries)
     {
         IonMobilityLibrary libResult;
         if (!_loadedIonMobilityeLibraries.TryGetValue(dtLib.Name, out libResult))
         {
             libResult = (IonMobilityLibrary) dtLib.Initialize(new LoadMonitor(this, container, dtLib));
             if (libResult != null)
                 _loadedIonMobilityeLibraries.Add(libResult.Name, libResult);
         }
         return libResult;
     }
 }
예제 #5
0
 public bool Equals(IonMobilityLibrary other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return base.Equals(other) && Equals(other._database, _database) && Equals(other.DatabasePath, DatabasePath);
 }