public EventUserControl(Event e)
        {
            InitializeComponent();

            _e = e;

            this.VerticalAlignment = System.Windows.VerticalAlignment.Top;
            this.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this.BorderElement.Background = e.Color;

            string instrumentInfo = e.EventInfo.Instruments.Count > 0 ? (" - Instrumentos a utilizar: " + string.Join(", ", e.EventInfo.Instruments.Select(i => i.Name))) : string.Empty;

            this.txbEventIdDateAndTreatment.Text = String.Format("Cita #{0} - {1} ({2} - {3}){4}", e.EventInfo.EventId, e.EventInfo.Treatment.Name, e.EventInfo.StartEvent.ToString("HH:mm"), e.EventInfo.EndEvent.ToString("HH:mm"), instrumentInfo);
            this.txbPatientName.Text = "Paciente: " + e.EventInfo.Patient.FirstName + " " + e.EventInfo.Patient.LastName;
            this.BorderElement.ToolTip = this.txbEventIdDateAndTreatment.Text + System.Environment.NewLine + this.txbPatientName.Text;
        }
 private void GetConcurrentEvents(Event e, List<Event> concurrentEvents)
 {
     foreach (Event ev in TodayEvents)
     {
         if (Controllers.Utils.IsOverlappedTime(e.EventInfo.StartEvent, e.EventInfo.EndEvent, ev.EventInfo.StartEvent, ev.EventInfo.EndEvent) 
             && !concurrentEvents.Contains(ev))
         {
             concurrentEvents.Add(ev);
             GetConcurrentEvents(ev, concurrentEvents);
         }
     }
 }
 public void AddEventWithoutRepaint(Event e)
 {
     Events.Add(e);
 }
        public void AddEvent(Event e)
        {
            if (e.EventInfo.StartEvent > e.EventInfo.EndEvent)
            {
                throw new ArgumentException("End date is before Start date");
            }

            Events.Add(e);

            if (OnEventAdded != null)
            {
                OnEventAdded(this, e);
            }
        }
 void InnerScheduler_OnEventMouseLeftButtonDown(object sender, Event e)
 {
     if (OnEventMouseLeftButtonDown != null)
     {
         OnEventMouseLeftButtonDown(sender, e);
     }
 }
 void InnerScheduler_OnScheduleContextMenuEvent(object sender, Event e)
 {
     if (OnScheduleContextMenuEvent != null)
     {
         OnScheduleContextMenuEvent(sender, e);
     }
 }