Ejemplo n.º 1
0
        /// <summary>
        /// Drags the given appointment from one view to another
        /// </summary>
        /// <param name="pv">Previous view</param>
        /// <param name="av">Item to drag</param>
        private bool DragAppointment(TimeLineView pv, AppointmentView av)
        {
            // Set the new owner and selected view, and
            // recalc the new layout

            av.Appointment.OwnerKey = OwnerKey;

            NeedRecalcLayout = true;
            RecalcSize();

            CalendarView.SelectedOwnerIndex = this.DisplayedOwnerKeyIndex;

            // Get the new view

            AppointmentView view = GetAppointmentView(av.Appointment);

            if (view != null)
                SetNewDragItem(pv, view);

            return (true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Drags the given appointment from one view to another
        /// </summary>
        /// <param name="pv">Previous view</param>
        /// <param name="av">Item to move</param>
        private bool DragAppointment(WeekDayView pv, AppointmentView av)
        {
            // Set the new owner and selected view, and
            // recalc the new layout

            av.Appointment.OwnerKey = OwnerKey;

            if (NumberOfColumns > 1)
            {
                DateTime sd = av.Appointment.StartTime;

                if (Bounds.X > pv.Bounds.X)
                {
                    av.Appointment.MoveTo(
                        new DateTime(_DayColumns[0].Date.Year, _DayColumns[0].Date.Month,
                        _DayColumns[0].Date.Day, sd.Hour, sd.Minute, 0));
                }
                else
                {
                    av.Appointment.MoveTo(
                        new DateTime(_DayColumns[NumberOfColumns - 1].Date.Year,
                        _DayColumns[NumberOfColumns - 1].Date.Month,
                        _DayColumns[NumberOfColumns - 1].Date.Day, sd.Hour, sd.Minute, 0));
                }
            }

            NeedRecalcLayout = true;
            RecalcSize();

            CalendarView.SelectedOwnerIndex = this.DisplayedOwnerKeyIndex;

            // Get the new view

            AppointmentView view = GetAppointmentView(av.Appointment);

            if (view != null)
                SetNewDragItem(pv, view);

            return (true);
        }