Exemplo n.º 1
0
        public void ConvertRecposToNativeWithNegativeCentriesTotal()
        {
            var recpos = new JET_RECPOS();
            recpos.centriesLT = 1;
            recpos.centriesTotal = Int64.MinValue;

            NATIVE_RECPOS native = recpos.GetNativeRecpos();
        }
Exemplo n.º 2
0
        public void ConvertRecposToNativeWithNegativeCentriesLt()
        {
            var recpos = new JET_RECPOS();
            recpos.centriesLT = -1;
            recpos.centriesTotal = 10;

            NATIVE_RECPOS native = recpos.GetNativeRecpos();
        }
Exemplo n.º 3
0
        public void ConvertRecposToNative()
        {
            var recpos = new JET_RECPOS();
            recpos.centriesLT = 5;
            recpos.centriesTotal = 10;

            NATIVE_RECPOS native = recpos.GetNativeRecpos();
            Assert.AreEqual(5U, native.centriesLT);
            Assert.AreEqual(10U, native.centriesTotal);
        }
Exemplo n.º 4
0
        public void ConvertRecposFromNative()
        {
            var native = new NATIVE_RECPOS();
            native.centriesLT = 1;
            native.centriesTotal = 2;

            var recpos = new JET_RECPOS();
            recpos.SetFromNativeRecpos(native);

            Assert.AreEqual(1, recpos.centriesLT);
            Assert.AreEqual(2, recpos.centriesTotal);
        }
Exemplo n.º 5
0
 public void GotoLastPosition()
 {
     var recpos = new JET_RECPOS() { centriesLT = 4, centriesTotal = 4 };
     Api.JetGotoPosition(this.sesid, this.tableid, recpos);
     int actual = this.GetLongColumn();
     Assert.AreEqual(this.numRecords - 1, actual);
 }
Exemplo n.º 6
0
 public void GotoFirstPosition()
 {
     var recpos = new JET_RECPOS() { centriesLT = 0, centriesTotal = 10 };
     Api.JetGotoPosition(this.sesid, this.tableid, recpos);
     int actual = this.GetLongColumn();
     Assert.AreEqual(0, actual);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Moves a cursor to a new location that is a fraction of the way through
 /// the current index. 
 /// Also see <seealso cref="JetGetRecordPosition"/>.
 /// </summary>
 /// <param name="sesid">The session to use.</param>
 /// <param name="tableid">The cursor to position.</param>
 /// <param name="recpos">The approximate position to move to.</param>
 public static void JetGotoPosition(JET_SESID sesid, JET_TABLEID tableid, JET_RECPOS recpos)
 {
     Api.Check(Impl.JetGotoPosition(sesid, tableid, recpos));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Returns the fractional position of the current record in the current index
 /// in the form of a <see cref="JET_RECPOS"/> structure.
 /// Also see <seealso cref="JetGotoPosition"/>.
 /// </summary>
 /// <param name="sesid">The session to use.</param>
 /// <param name="tableid">The cursor positioned on the record.</param>
 /// <param name="recpos">Returns the approximate fractional position of the record.</param>
 public static void JetGetRecordPosition(JET_SESID sesid, JET_TABLEID tableid, out JET_RECPOS recpos)
 {
     Api.Check(Impl.JetGetRecordPosition(sesid, tableid, out recpos));
 }
Exemplo n.º 9
0
        /// <summary>
        /// Goto the given fractional position on the current index
        /// </summary>
        /// <param name="position">The desired position on the current index of the cursor</param>
        /// <remarks>
        /// As a side effect, any restriction in effect will be cleared.
        /// </remarks>
        public void GotoPosition(Position position)
        {
            lock (this.isamSession)
            {
                this.CheckDisposed();
                this.OnNavigation();

                // clear our index range
                this.FindAllRecords();

                // go to the given fractional position on the current index
                JET_RECPOS recpos = new JET_RECPOS();
                recpos.centriesLT = position.Entry;
                recpos.centriesTotal = position.TotalEntries;
                Api.JetGotoPosition(this.isamSession.Sesid, this.tableid, recpos);

                // clear our field cache because the current record has changed
                this.fields = null;
            }
        }
Exemplo n.º 10
0
 public void JetRecposToString()
 {
     var recpos = new JET_RECPOS { centriesLT = 5, centriesTotal = 10 };
     Assert.AreEqual("JET_RECPOS(5/10)", recpos.ToString());
 }