/// <summary> /// OnWillMove event is called before a pending operation changes the current position in the ADORecordsetHelper. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> protected void OnWillMove(EventReasonEnum reason, ref EventStatusEnum status) { if (WillMove != null) { MoveEventArgs args = new MoveEventArgs(reason, status); WillMove(this, args); status = args.Status; } }
/// <summary> /// Handles the WillMove event of the underlying Recordset, triggering the control's WillMove event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_WillMove(object eventSender, MoveEventArgs e) { EventStatusEnum status = e.Status; OnWillMove(e.Reason, ref status); e.Status = status; }
/// <summary> /// OnWillMove event is called before a pending operation changes the current position in the ADORecordsetHelper. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">An EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> protected void OnWillMove(EventReasonEnum reason, ref EventStatusEnum status) { firstChange = true; if (WillMove != null) { MoveEventArgs args = new MoveEventArgs(reason, status); WillMove(this, args); status = args.Status; firstChange = status == EventStatusEnum.adStatusCancel ? false : true; } }