static CustomEvent CreateEvent(string subject, object resourceId, int status, int label) { CustomEvent apt = new CustomEvent(); apt.Subject = subject; apt.OwnerId = resourceId; Random rnd = DemoUtils.RandomInstance; int rangeInMinutes = 60 * 24; apt.StartTime = DateTime.Today + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes)); apt.EndTime = apt.StartTime + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes / 4)); apt.Status = status; apt.Label = label; return(apt); }
CustomEvent CreateEvent(SchedulerBindingList <CustomEvent> eventList, string subject, object resourceId, int status, int label) { CustomEvent apt = new CustomEvent(); apt.Subject = subject; apt.OwnerId = resourceId; Random rnd = DemoUtils.RandomInstance; int rangeInMinutes = 60 * 24; apt.StartTime = new DateTime(2010, 7, 13) + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes)); apt.EndTime = apt.StartTime + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes / 4)); apt.Status = status; apt.Label = label; return(apt); }