The Notify event handler is fired when the notification queue is submitted.
Queue
The NotifyEventArgs argument holds a collection of actions (e.Queue) which should be processed one by one.
ASP.NET WebForms
See Demo/Calendar/Notify.aspx.cs.
protected void DayPilotCalendar1_Notify(object sender, DayPilot.Web.Ui.Events.Calendar.NotifyEventArgs e)
{
foreach(DayPilotEventArgs ea in e.Queue)
{
if (ea is EventAddEventArgs)
{
EventAddEventArgs em = (EventAddEventArgs)ea;
DayPilotCalendar1_EventAdd(sender, em);
}
else if (ea is EventMoveEventArgs)
{
EventMoveEventArgs em = (EventMoveEventArgs) ea;
DayPilotCalendar1_EventMove(sender, em);
}
else if (ea is EventRemoveEventArgs)
{
EventRemoveEventArgs em = (EventRemoveEventArgs) ea;
DayPilotCalendar1_EventRemove(sender, em);
}
else if (ea is EventUpdateEventArgs)
{
DayPilotCalendar1_EventUpdate(sender, (EventUpdateEventArgs) ea);
}
}
string msg = String.Format("Queue saved ({0} actions).", e.Queue.Count);
DayPilotCalendar1.UpdateWithMessage(msg);
}
ASP.NET MVC
protected override void OnNotify(NotifyArgs e)
{
foreach(DayPilotArgs a in e.Queue)
{
if (a is EventUpdateArgs)
{
EventUpdateArgs updateArgs = (EventUpdateArgs) a;
string id = updateArgs.Event.Value;
string newText = updateArgs.New.Text;
// update the db
}
}
Update();
}
DayPilot