/// <summary> /// Removes a source that is currently managed by MagneticCardReader. /// </summary> /// <param name="source">The instance of the source to remove.</param> /// <remarks>This method will call IMagneticCardReaderSource.EndReading /// and IMagneticCardReaderSource.Shutdown before the source is /// removed.</remarks> public void RemoveSource(IMagneticCardReaderSource source) { int index = m_otherSources.IndexOf(source); if (index > -1) { m_otherSources[index].EndReading(); m_otherSources[index].Shutdown(); m_otherSources.RemoveAt(index); } }
/// <summary> /// Adds a new card reader source that will be managed by /// MagneticCardReader. /// </summary> /// <param name="source">The instance of the source to add.</param> /// <remarks>This method will call IMagneticCardReaderSource.Initialize /// and, potentially, IMagneticCardReaderSource.BeginReading on the /// specified source.</remarks> public void AddSource(IMagneticCardReaderSource source) { if (!m_otherSources.Contains(source)) { m_otherSources.Add(source); source.Initialize(this); if (m_readingCards) { source.BeginReading(); } } }