/// <summary> /// Get Paged Records /// </summary> /// <param name="query"></param> /// <param name="source"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="cursorType"></param> /// <param name="lockType"></param> /// <param name="options"></param> /// <param name="cursorLocation"></param> /// <returns></returns> public Recordset GetPagedRecords(string query, DataSource source, int pageIndex, int pageSize = 100, CursorTypeEnum cursorType = CursorTypeEnum.adOpenDynamic, LockTypeEnum lockType = LockTypeEnum.adLockOptimistic, CommandTypeEnum options = CommandTypeEnum.adCmdText, CursorLocationEnum cursorLocation = CursorLocationEnum.adUseClient) { _connection = new Connection(); var cnStr = GetConnectionString(source); _connection.Open(cnStr, null, null, 0); _recordSet = new Recordset { CursorLocation = cursorLocation, CacheSize = pageSize, PageSize = pageSize }; //_recordSet.Open(query,_connection, cursorType, lockType, (int)options); _recordSet.Open(query, _connection); if (_recordSet.RecordCount != 0) { _recordSet.AbsolutePage = (PositionEnum)pageIndex; } return(_recordSet); }
public void SetCursorType(CursorTypeEnum cursorType) { Debug.LogFormat("ScrollCursor - Cursor type changed: {0}", cursorType); System.Diagnostics.Debug.WriteLine(string.Format("ScrollCursor - Cursor type changed: {0}", cursorType)); CursorType = cursorType; if (BaseCursor != null && BaseCursor.activeSelf != (CursorType == CursorTypeEnum.Default)) { BaseCursor.SetActive(CursorType == CursorTypeEnum.Default); } if (JoystickCursor != null && JoystickCursor.activeSelf != (CursorType == CursorTypeEnum.Joystick)) { JoystickCursor.SetActive(CursorType == CursorTypeEnum.Joystick); } if (InvertedJoystickCursor != null && InvertedJoystickCursor.activeSelf != (CursorType == CursorTypeEnum.JoystickInverted)) { InvertedJoystickCursor.SetActive(CursorType == CursorTypeEnum.JoystickInverted); } if (StickyCursor != null && StickyCursor.activeSelf != (CursorType == CursorTypeEnum.Sticky)) { StickyCursor.SetActive(CursorType == CursorTypeEnum.Sticky); } if (LookCursor != null && LookCursor.activeSelf != (CursorType == CursorTypeEnum.Look)) { LookCursor.SetActive(CursorType == CursorTypeEnum.Look); } }
private CursorMapping GetCursorMapping(CursorTypeEnum cursorType) { foreach (CursorMapping item in cursorMappings) { if (item.cursorType == cursorType) { return(item); } } return(cursorMappings[0]); }
/// <summary> /// Get Records /// </summary> /// <param name="query"></param> /// <param name="source"></param> /// <param name="cursorType"></param> /// <param name="lockType"></param> /// <param name="options"></param> /// <param name="cursorLocation"></param> /// <returns>RecordSet</returns> public Recordset GetRecords(string query, DataSource source, CursorTypeEnum cursorType = CursorTypeEnum.adOpenDynamic, LockTypeEnum lockType = LockTypeEnum.adLockOptimistic, CommandTypeEnum options = CommandTypeEnum.adCmdText, CursorLocationEnum cursorLocation = CursorLocationEnum.adUseClient) { _connection = new Connection(); var cnStr = GetConnectionString(source); _connection.Open(cnStr, null, null, 0); _recordSet = new Recordset { CursorLocation = cursorLocation }; _recordSet.Open(query, _connection, cursorType, lockType, (int)options); return(_recordSet); }
/// <summary> /// Get the record count /// </summary> /// <param name="query"></param> /// <param name="source"></param> /// <param name="cursorType"></param> /// <param name="lockType"></param> /// <param name="options"></param> /// <param name="cursorLocation"></param> /// <returns></returns> public short GetRecordCount(string query, DataSource source, CursorTypeEnum cursorType = CursorTypeEnum.adOpenDynamic, LockTypeEnum lockType = LockTypeEnum.adLockOptimistic, CommandTypeEnum options = CommandTypeEnum.adCmdText, CursorLocationEnum cursorLocation = CursorLocationEnum.adUseClient) { _connection = new Connection(); var cnStr = GetConnectionString(source); _connection.Open(cnStr, null, null, 0); _recordSet = new Recordset { CursorLocation = cursorLocation }; _recordSet.Open(query, _connection); var returnValue = (short)_recordSet.RecordCount; _recordSet = null; return(returnValue); }
public void Open(object value, object missing, CursorTypeEnum adOpenStatic, LockTypeEnum adLockOptimistic, int i) { throw new System.NotImplementedException(); }
public Recordset CreateRecordset(SqlFrag frag, CommandTypeEnum eCmdType = CommandTypeEnum.adCmdText, CursorLocationEnum eCursorLoc = CursorLocationEnum.adUseClient, CursorTypeEnum eCursorType = CursorTypeEnum.adOpenDynamic, LockTypeEnum eLockType = LockTypeEnum.adLockOptimistic, ExecuteOptionEnum eExecOptions = ExecuteOptionEnum.adOptionUnspecified) { ADODB.Command SqlCmd = GenerateCommand(eCmdType, frag); Recordset rRecords = new Recordset(); rRecords.CursorLocation = eCursorLoc; rRecords.Open(SqlCmd, Type.Missing, eCursorType, eLockType, (int)eExecOptions); return(rRecords); }
private void SetCursor(CursorTypeEnum cursorType) { CursorMapping mapping = GetCursorMapping(cursorType); Cursor.SetCursor(mapping.texture, mapping.hotspot, CursorMode.Auto); }