예제 #1
0
 internal void ResetSession()
 {
     if (iSession != null)
     {
         try { iSession.CeRapiUninit(); } catch { }
     }
     iSession       = null;
     sessionFailure = false;
 }
예제 #2
0
 internal DeviceFile(IRAPISession sess, string fileName, uint dwDesiredAccess, uint dwShareMode, uint dwCreationDistribution, uint dwFlags)
     : base(InvalidHandleValue, true)
 {
     this.sess = sess;
     Name      = fileName;
     SetHandle(sess.CeCreateFile(fileName, dwDesiredAccess, dwShareMode, IntPtr.Zero, dwCreationDistribution, dwFlags, IntPtr.Zero));
     if (IsInvalid)
     {
         throw new RapiException(sess.CeGetLastError());
     }
 }
예제 #3
0
 internal RemoteDatabase(IRAPISession s, uint objId)
 {
     sess   = s;
     handle = new RemoteDevice.DeviceHandle(sess, sess.CeOpenDatabase(ref objId, null, 0, CEDB_AUTOINCREMENT, IntPtr.Zero));
     if (handle.IsInvalid)
     {
         throw new RapiException(sess.CeGetLastError());
     }
     ObjectId        = objId;
     CurrentRecordId = 0;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoteDatabase"/> class and opens an existing database in the object store on a remote Microsoft® Windows® CE–based device.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="objId">The object identifier of the database to be opened.</param>
 /// <param name="autoIncr">If set to <c>true</c> current seek position is automatically incremented with each call to the ReadRecordProps method.</param>
 /// <param name="sortId">Property identifier of the primary key for the sort order in which the database is to be traversed. Subsequent calls to Seek assume this sort order. This parameter can be zero if the sort order is not important.</param>
 public RemoteDatabase(RemoteDevice device, uint objId, bool autoIncr, uint sortId)
 {
     sess   = device.ISession;
     handle = new RemoteDevice.DeviceHandle(sess, sess.CeOpenDatabase(ref objId, null, sortId, autoIncr ? CEDB_AUTOINCREMENT : 0, IntPtr.Zero));
     if (handle.IsInvalid)
     {
         device.ThrowRAPIException();
     }
     ObjectId        = objId;
     CurrentRecordId = 0;
 }
예제 #5
0
 internal DeviceFile(IRAPISession sess, string fileName)
     : this(sess, fileName, 0, 1, 3, 0x80)
 {
 }
예제 #6
0
 internal RemoteDatabaseEnum(IRAPISession session, uint dbType)
 {
     sess        = session;
     this.dbType = dbType;
     Reset();
 }
예제 #7
0
 /// <summary>
 /// Cleans up all internal references.
 /// </summary>
 public void Dispose()
 {
     sess = null;
     GC.SuppressFinalize(this);
 }
예제 #8
0
 internal RemoteDatabaseList(IRAPISession session, uint dbType)
 {
     sess        = session;
     this.dbType = dbType;
 }
예제 #9
0
 internal DeviceRegistryKey(IRAPISession session, uint handle, string keyName)
 {
     sess = session;
     hKey = handle;
     Name = keyName;
 }
예제 #10
0
 internal DeviceRegistryKey(IRAPISession session)
 {
     sess = session;
 }
예제 #11
0
 public DeviceHandle(IRAPISession session, IntPtr handle)
     : base(InvalidHandleValue, true)
 {
     sess = session;
     SetHandle(handle);
 }