CursorClone() private méthode

private CursorClone ( IntPtr handle, IntPtr &clone ) : int
handle System.IntPtr
clone System.IntPtr
Résultat int
        /// <summary>
        /// Clones a Database Cursor
        /// </summary>
        /// <remarks>
        /// This method wraps the native ups_cursor_clone function.
        /// <br />
        /// Clones an existing Cursor. The new Cursor will point to exactly the
        /// same item as the old Cursor. If the old Cursor did not point
        /// to any item, so will the new Cursor.
        ///
        /// If the old Cursor is bound to a Transaction, then the new
        /// Cursor will also be bound to this Transaction.
        /// </remarks>
        /// <returns>The new Cursor object</returns>
        /// <exception cref="DatabaseException">
        ///   <list type="bullet">
        ///   <item><see cref="UpsConst.UPS_OUT_OF_MEMORY"/>
        ///     if the new structure could not be allocated</item>
        ///   </list>
        /// </exception>
        public Cursor Clone()
        {
            IntPtr newHandle = new IntPtr(0);

            lock (this.db) {
                int st = NativeMethods.CursorClone(handle, out newHandle);
                if (st != 0)
                {
                    throw new DatabaseException(st);
                }
                Cursor c = new Cursor(db, newHandle);
                db.AddCursor(c);
                return(c);
            }
        }