Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomSchedulerStorage.EndUpdate Method

In This Article

Updates storage and releases a lock on the data controller.

#Declaration

Delphi
procedure EndUpdate;

#Remarks

This method is combined with the BeginUpdate method (that acquires the lock) to contain a block of update statements. Since the execution of the block of statements can exit with either a normal or exception state, these statements and the EndUpdate method should be contained within try… finally… blocks following the BeginUpdate method to ensure the lock will be released in all cases.

For clarity a code sample is given below:

Delphi
//...
var
  I: Integer;
  AEvent: TcxSchedulerEvent;
begin
  cxSchedulerStorage.BeginUpdate;
  try
    for I := 0 to 1 do
    begin
      AEvent := cxScheduler.Storage.CreateEvent;
      AEvent.Start := EncodeDateTime(2004, 7, 7, 10, 0, 0, 0);
      AEvent.Duration := Random(100) / 500;
      AEvent.Message := 'Created on start up';
      AEvent.Caption := 'Event # ' + IntToStr(I);
    end;
  finally
    cxSchedulerStorage.EndUpdate;
  end;
end;
See Also