public override object Clone() { TubeRackList tubeRacks = new TubeRackList(); foreach (TubeRack tubeRack in this) { tubeRacks.Add(tubeRack); } return(tubeRacks); }
public static GenericContainerList GetGenericContainers(DataReader dataReader) { // This function differ from the original Chiasma-function // No need to implement classes for plates, tubes, flowcells and beadchips here. GenericContainerList containers = null; GenericContainerList containersSubGroup = null; TubeRackList tubeRacks; containers = new GenericContainerList(); while (dataReader.Read()) { // Add containers, not BeadChip, plate or tube. containers.Add(ContainerManager.GetContainer(dataReader)); } containers.Sort(); if (dataReader.NextResult()) { tubeRacks = new TubeRackList(); while (dataReader.Read()) { tubeRacks.Add(new TubeRackForTagSource(dataReader)); } tubeRacks.Sort(); containers.AddRange(tubeRacks); } if (dataReader.NextResult()) { containersSubGroup = new GenericContainerList(); while (dataReader.Read()) { // Add FlowCells. containersSubGroup.Add(new GenericContainer(dataReader, ContainerType.FlowCell)); } containersSubGroup.Sort(); containers.AddRange(containersSubGroup); } if (dataReader.NextResult()) { containersSubGroup = new GenericContainerList(); while (dataReader.Read()) { // Add BeadChips. containersSubGroup.Add(new GenericContainer(dataReader, ContainerType.BeadChip)); } containersSubGroup.Sort(); containers.AddRange(containersSubGroup); } if (dataReader.NextResult()) { containersSubGroup = new GenericContainerList(); while (dataReader.Read()) { // Add plates. containersSubGroup.Add(new GenericContainer(dataReader, ContainerType.Plate)); } containersSubGroup.Sort(); containers.AddRange(containersSubGroup); } if (dataReader.NextResult()) { containersSubGroup = new GenericContainerList(); while (dataReader.Read()) { // Add tubes. containersSubGroup.Add(new GenericContainer(dataReader, ContainerType.Tube)); } containersSubGroup.Sort(); containers.AddRange(containersSubGroup); } return(containers); }