public override void Add(IPositionUpdateable updateable) { if (updateable.PositionUpdater == null) { updateable.PositionUpdater = this; var ccdUpdateable = updateable as ICCDPositionUpdateable; if (ccdUpdateable != null) { switch (ccdUpdateable.PositionUpdateMode) { case PositionUpdateMode.Discrete: discreteUpdateables.Add(updateable); break; case PositionUpdateMode.Passive: passiveUpdateables.Add(ccdUpdateable); break; case PositionUpdateMode.Continuous: continuousUpdateables.Add(ccdUpdateable); break; } } else discreteUpdateables.Add(updateable); } else { throw new Exception("Cannot add object to Integrator; it already belongs to one."); } }