Coordinates interactive appointment resizing and raises notifications for the start, intermediate changes, and completion.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.Scheduler.dll
Syntax:
public class AppointmentResizingBehavior
Inheritance: objectAppointmentResizingBehavior
Constructors
Initializes the behavior for the specified Scheduler.
public AppointmentResizingBehavior(RadScheduler scheduler)
The Scheduler whose appointments can be resized.
Initializes the behavior with the visual element that owns the appointment being resized.
public AppointmentResizingBehavior(SchedulerVisualElement activeOwner)
The Scheduler visual element that owns the appointment.
Fields
Indicates that the bottom edge is the active resize edge.
protected bool downResize
Indicates that the left edge is the active resize edge.
protected bool leftResize
Stores the resize offset supplied through the current ResizeOptions.
protected float resizeStepOffset
Indicates that the right edge is the active resize edge.
protected bool rightResize
Properties
Gets or sets the active resizing appointment.
public IEvent ActiveAppointment { get; }
Gets or sets a value indicating whether the appointment areas in DayView should be automatically scrolled when dragging off their bounds.
public bool AutoScrollDayViewOnResize { get; set; }
Gets or sets the bounds offset which specifies the size of the sizing rectangles.
public int CursorBoundsOffset { get; set; }
Gets or sets whether the user is currently resizing the active appointment.
public virtual bool IsResizing { get; }
Gets or sets the resize minutes.
public int ResizeMinutes { get; set; }
Methods
Gets the endpoint-change details recorded by the most recent resize adjustment.
public ResizeInformation GetResizeInformation()
The recorded old and new dates and resize direction, or null if no endpoint has changed.
Builds resize orientation, offset, and minute-step settings from the type and layout of the active view owner.
protected virtual ResizeOptions GetResizeOptions(SchedulerVisualElement owner)
The visual element that owns the appointment.
Returns:The resize settings derived from the owner, or default settings when the owner is null.
Changes the appointment's start or end date to the target cell boundary, subject to cancellation and recurrence validation.
protected virtual bool HandleAppointmentHorizontalResize(SchedulerCellElement cell, IEvent appointment)
The cell containing the proposed endpoint.
appointmentIEventThe appointment being resized.
Returns:true when an endpoint change is accepted and applied.
Changes the appointment's start or end time to the target cell boundary, subject to cancellation and recurrence validation.
protected virtual bool HandleAppointmentVerticalResize(SchedulerCellElement cell, IEvent appointment)
The cell containing the proposed endpoint.
appointmentIEventThe appointment being resized.
Returns:true when an endpoint change is accepted and applied.
Raises AppointmentResized with the appointment's resize notification data.
protected virtual void OnAppointmentResized(AppointmentResizedEventArgs args)
The appointment resize event data.
Raises AppointmentResizing before resize processing; handlers can cancel the operation.
protected virtual void OnAppointmentResizing(AppointmentResizingEventArgs cancelArgs)
The appointment event data and cancellation state.
Raises the completion event and notifies the Scheduler that resizing has ended.
protected virtual void OnFinished(IEvent appointment)
The appointment whose resize has finished.
Requests a resize start.
public bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner, bool start)
Requests a resize start.
public virtual bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner, Point cursorPosition, ResizeOptions resizeOptions, bool start)
Requests a resize start.
public bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner, Point cursorPosition, ResizeOptions resizeOptions)
Requests a resize start.
public bool RequestResize(AppointmentElement appointment, SchedulerVisualElement newOwner)
Sets the Scheduler cursor to the resize cursor for the active orientation, or resets it when no resize is active.
protected virtual void UpdateMouseCursor()
Updates the current mouse cursor.
protected virtual bool UpdateMouseCursor(Point mousePosition, Rectangle nearRect, Rectangle farRect)
The current position
nearRectRectangleThe top or left area of the appointment which can start a resize
farRectRectangleThe bottom or right area of the appointment which can start a resize
Returns:True if the mouse position is in a resize location, false otherwise.
Updates the behavior's orientation, resize offset, and minute-step settings from the supplied options.
public void UpdateResizeOptions(ResizeOptions resizeOptions)
The settings to apply to subsequent resize operations.
Checks the proposed interval against other occurrences in the active view, rejecting it if another occurrence's start or end falls inside it.
protected virtual bool ValidateExceptionDates(IEvent resized, DateTime startDate, TimeSpan duration)
The recurring appointment occurrence being resized.
startDateDateTimeThe proposed start date.
durationTimeSpanThe proposed duration.
Returns:true when the current occurrence-boundary check passes.
Events
Occurs when the appointment is resized.
public event EventHandler<AppointmentResizedEventArgs> AppointmentResized
Occurs when the appointment is resizing.
public event EventHandler<AppointmentResizingEventArgs> AppointmentResizing
Occurs when the resizing operation is finished.
public event EventHandler<SchedulerAppointmentEventArgs> Finished
Occurs when the rezing request is initialized.
public event EventHandler Initialized