AddCursor() public method

Adds a Cursor to the Cursor list
public AddCursor ( Cursor c ) : void
c Cursor
return void
Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new Cursor in a Transaction
 /// </summary>
 /// <remarks>
 /// This method wraps the native ups_cursor_create function.
 /// <br />
 /// Creates a new Database Cursor. Cursors can be used to traverse
 /// the Database from start to end or vice versa. Cursors can also
 /// be used to insert, delete or search Database items.
 ///
 /// A newly created Cursor does not point to any item in the Database.
 ///
 /// The application should close all Database Cursors before closing
 /// the Database.
 /// </remarks>
 /// <param name="db">The Database object</param>
 /// <param name="txn">The optional Transaction</param>
 /// <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 void Create(Database db, Transaction txn)
 {
     this.db = db;
     lock (this.db) {
         int st = NativeMethods.CursorCreate(out handle, db.Handle,
                                             txn != null ? txn.Handle : IntPtr.Zero, 0);
         if (st != 0)
         {
             throw new DatabaseException(st);
         }
         db.AddCursor(this);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new Cursor in a Transaction
 /// </summary>
 /// <remarks>
 /// This method wraps the native ups_cursor_create function.
 /// <br />
 /// Creates a new Database Cursor. Cursors can be used to traverse
 /// the Database from start to end or vice versa. Cursors can also
 /// be used to insert, delete or search Database items.
 ///
 /// A newly created Cursor does not point to any item in the Database.
 ///
 /// The application should close all Database Cursors before closing
 /// the Database.
 /// </remarks>
 /// <param name="db">The Database object</param>
 /// <param name="txn">The optional Transaction</param>
 /// <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 void Create(Database db, Transaction txn)
 {
     this.db = db;
       lock (this.db) {
     int st = NativeMethods.CursorCreate(out handle, db.Handle,
         txn != null ? txn.Handle : IntPtr.Zero, 0);
     if (st != 0)
       throw new DatabaseException(st);
     db.AddCursor(this);
       }
 }