public MyAppointment AddAppointment(Date startDate, Time startTime, Date endDate, Time endTime, string subject, string description = "", object resourceId = null, string resourceCaption = null)
        {
            {
                var col = resourceId as ColumnBase;
                if (col != null)
                {
                    resourceId = col.Value;
                }
            }

            var my  = new DevExpressIntegration.MyAppointment();
            var app = StaticAppointmentFactory.CreateAppointment(AppointmentType.Normal,
                                                                 startTime.AddToDateTime(startDate.ToDateTime()),
                                                                 endTime.AddToDateTime(endDate.ToDateTime()) - startTime.AddToDateTime(startDate.ToDateTime()),
                                                                 subject.TrimEnd());

            app.SetId(my);
            my.SetApp(app);
            app.Description = description.TrimEnd();
            _appointments.Add(app);
            if (resourceId != null)
            {
                app.ResourceId = resourceId;



                if (!_foundResources.Contains(resourceId))
                {
                    if (resourceCaption == null)
                    {
                        resourceCaption = resourceId.ToString().Trim();
                    }
                    _resources.Add(_form.schedulerControl1.Storage.CreateResource(resourceId, resourceCaption.TrimEnd()));
                    _foundResources.Add(resourceId);
                }
            }
            return(my);
        }
 public void SetEnd(Date endDate, Time time)
 {
     _app.End = time.AddToDateTime(endDate);
 }
 public void SetStart(Date startDate, Time time)
 {
     _app.Start = time.AddToDateTime(startDate);
 }