using System;
using System.Linq;
using WebMail.Model;
using Telerik.Web.UI;

public static class SchedulerHelper
{
    public static readonly Func<Event, Appointment> AppointmentsResolver = (ev) =>
    {
        Appointment app = new Appointment();

        app.ID = ev.ID;
        app.Subject = ev.Subject;
        app.Start = ev.Start;
        app.End = ev.End;
        app.RecurrenceRule = ev.RecurrenceRule;
        app.RecurrenceParentID = ev.RecurrenceParentID;
        app.TimeZoneID = ev.TimeZoneID;
        app.Attributes.Add("Location", ev.Location);
        app.Attributes.Add("Invitees", ev.Invitees);

        return app;
    };

    public static readonly Func<Folder, Resource> ResourcesResolver = (f) =>
    {
        Resource resource = new Resource();

        resource.Key = f.Id;
        resource.Text = f.Name;
        resource.Type = "Calendar";

        return resource;
    };
}