/// <summary> /// Performs any initialization needed for the card reader. /// </summary> /// <param name="parent">The MagneticCardReader instance to which this /// reader belongs.</param> public void Initialize(MagneticCardReader parent) { if (!m_initialized) { try { m_parent = parent; // Start the listening thread for the card swipes. lock (m_terminateSync) { m_terminateThread = false; m_listenThread = new Thread(ThreadWorker); m_listenThread.IsBackground = true; m_listenThread.Start(); } m_initialized = true; } catch { Shutdown(); } } }
/// <summary> /// Initializes a new instance of the MagCardForm class in window /// mode. /// </summary> /// <param name="magCardReader">The mag. card reader used to dectect /// swipes.</param> /// <exception cref="System.ArgumentNullException">magCardReader is a /// null reference.</exception> public MagCardForm(MagneticCardReader magCardReader) : base(new NormalDisplayMode()) { // PDTS 1064 if (magCardReader == null) { throw new ArgumentNullException("magCardReader"); } // Start listening for swipes. m_magCardReader = magCardReader; m_magCardReader.CardSwiped += new MagneticCardSwipedHandler(CardSwiped); InitializeComponent(); m_cancelButton.Text = "Cancel"; ApplyDisplayMode(); }
/// <summary> /// Initializes a new instance of the PlayerSearchForm class. /// </summary> /// <param name="defaultCardSearch">true if the default search mode is /// by card; otherwise false.</param> /// <param name="operatorId">The id of the operator who's players to /// search.</param> /// <param name="magCardReader">The mag. card reader used to swipe /// cards.</param> /// <param name="machineAccounts">Whether anonymous player accounts are /// linked to a machine.</param> /// <param name="forceEnglish">Whether to force English for the /// UI.</param> /// <exception cref="System.ArgumentNullException">magCardReader is a /// null reference.</exception> public PlayerSearchForm(bool defaultCardSearch, int operatorId, MagneticCardReader magCardReader, bool machineAccounts, bool forceEnglish) { // PDTS 1064 if (magCardReader == null) { throw new ArgumentNullException("magCardReader"); } InitializeComponent(); SetMaxTextLengths(); // Start listening for swipes. m_magCardReader = magCardReader; m_magCardReader.CardSwiped += new MagneticCardSwipedHandler(CardSwiped); m_operatorId = operatorId; m_machineAccounts = machineAccounts; m_forceEnglish = forceEnglish; // Do they want to search by cards by default. if (!defaultCardSearch) { m_cardSearchRadio.Checked = false; m_nameSearchRadio.Checked = true; SearchModeChanged(this, new EventArgs()); } else { m_cardNumber.Select(); } // Change some text on the UI if they are anonymous machine accounts. if (m_machineAccounts) { Text = Resources.SearchMachines; m_cardSearchRadio.Text = Resources.SearchByNumber; m_cardNumberLabel.Text = Resources.MachineNumber; m_okButton.Text = Resources.SelectMachine; m_resultsList.DisplayMember = "FullName"; } }
/// <summary> /// Performs any initialization needed for the card reader. /// </summary> /// <param name="parent">The MagneticCardReader instance to which this /// reader belongs.</param> public void Initialize(MagneticCardReader parent) { m_parent = parent; }