RFID.RFIDInterface.LakeChabotReader.BindReader C# (CSharp) Method

BindReader() public method

public BindReader ( rfidReaderID Reader ) : LakeChabotReader
Reader rfidReaderID
return LakeChabotReader
        public LakeChabotReader BindReader( rfidReaderID Reader )
        {
            if ( IsDisposed )
            {
                throw new ObjectDisposedException( "LakeChabotReader" );
            }

            if ( rfid.Constants.Result.OK != LakeChabotReader.LIBRARY_Result )
            {
                throw new rfidException( rfidErrorCode.LibraryFailedToInitialize );
            }

            if ( Mode == rfidReader.OperationMode.Static )
            {
                throw new rfidException( rfidErrorCode.CannotBindToStaticReader );
            }

            if ( Mode == rfidReader.OperationMode.BoundToReader )
            {
                throw new rfidException( rfidErrorCode.AlreadyBoundToAReader );
            }

            if ( Reader == null )
            {
                throw new ArgumentNullException( "Reader" );
            }

            //clark 2011.3.23 既留旅
            //if ( Reader.Handle == 0 )
            //{
            //    throw new rfidException( rfidErrorCode.InvalidRfidReaderID );
            //}

            _theReaderID = Reader;

            if ( Result.OK != this.initAntennaList( ) )
            {
                Console.WriteLine( "Error initializing antenna information from radio" );
            }

            CreateDataSet( );

            FunctionController.Name = Reader.Name;

            Mode = rfidReader.OperationMode.BoundToReader;

            _sessionTagList = new rfidTagList( );
            _requestTagList = new rfidTagList( );
            _periodTagList = new rfidTagList( );
            _commandTagList = new rfidTagList( );
            _antennaCycleTagList = new rfidTagList( );
            _antennaTagList = new rfidTagList( );
            _inventoryCycleTagList = new rfidTagList( );
            _inventoryRoundTagList = new rfidTagList( );

            DateTime temp = DateTime.UtcNow;
            _sessionStartMS = HighResolutionTimer.Milliseconds;
            _sessionStart = new DateTime( temp.Year, temp.Month,  temp.Day,
                                          temp.Hour, temp.Minute, temp.Second,
                                          Math.Min( 999, ( int ) ElapsedMilliseconds ),
                                          DateTimeKind.Utc );
            return this;
        }