Example #1
0
        /// <summary>
        /// Makes copies of reference-type members. This is a helper method for Cloning.
        /// </summary>
        /// <param name="dsEvent"></param>
        protected override void CopyTo(DockingStationEvent dsEvent)
        {
            // First, deep copy the base class.
            base.CopyTo(dsEvent);

            // Next, deep copy this subclass.
            InstrumentGasResponseEvent instrumentGasResponseEvent = (InstrumentGasResponseEvent)dsEvent;

            instrumentGasResponseEvent.GasResponses = new List <SensorGasResponse>();
            foreach (SensorGasResponse sgr in this.GasResponses)
            {
                instrumentGasResponseEvent.GasResponses.Add((SensorGasResponse)sgr.Clone());
            }

            instrumentGasResponseEvent.UsedGasEndPoints = new List <UsedGasEndPoint>();
            foreach (UsedGasEndPoint u in this.UsedGasEndPoints)
            {
                instrumentGasResponseEvent.UsedGasEndPoints.Add((UsedGasEndPoint)u.Clone());
            }

            instrumentGasResponseEvent.HighBumpFailCalGasResponses = new List <SensorGasResponse>();
            foreach (SensorGasResponse sgr in this.HighBumpFailCalGasResponses)
            {
                instrumentGasResponseEvent.HighBumpFailCalGasResponses.Add((SensorGasResponse)sgr.Clone());
            }
        }
 // SGF  06-Jun-2011  INS-1735 -- Moving to this class to make available to inherited classes.
 // SGF  15-Jun-2010  DSW-470 -- New
 public SensorGasResponse GetSensorGasResponse(InstrumentGasResponseEvent igrEvent, Sensor sensor)
 {
     for (int i = 0; i < igrEvent.GasResponses.Count; i++)
     {
         SensorGasResponse sgr = (SensorGasResponse)igrEvent.GasResponses[i];
         if (sensor.Uid == sgr.Uid)
         {
             return(sgr);
         }
     }
     return(null);
 }