Exemplo n.º 1
0
        /// <summary>
        /// Allows the reading of frames to be overriden
        /// </summary>
        /// <returns>The read frame</returns>
        protected virtual DataFrame ReadDataFrame()
        {
            DataFrame ret  = null;
            bool      done = true;

            do
            {
                IDataAdapter adapter = _adapter;

                done = true;

                if (_adapter != null)
                {
                    ret = _adapter.Read();

                    if (ret == null)
                    {
                        if (!Interlocked.ReferenceEquals(_adapter, adapter))
                        {
                            done = false;
                        }
                    }
                }
            }while (!done);

            return(ret);
        }