Exemple #1
0
        private int _MaximumPanelHeight;        // Panel height (max)

        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="weekDayView">WeekDayView</param>
        public AllDayPanel(WeekDayView weekDayView)
        {
            // Save the provided weekDayView and
            // tell the system we are a container

            _WeekDayView = weekDayView;

            SetIsContainer(true);

            SubItems.AllowParentRemove = false;
        }
        private bool _IsConnected;          // Connection status

        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">Assoc CalendarModel</param>
        /// <param name="weekDayView">Assoc WeekDayView</param>
        public ModelWeekDayViewConnector(CalendarModel model, WeekDayView weekDayView)
        {
            _Model = model;
            _View = weekDayView;
        }
Exemple #3
0
        /// <summary>
        /// Returns copy of the item.
        /// </summary>
        public override BaseItem Copy()
        {
            WeekDayView objCopy = new WeekDayView(this.CalendarView, this.ECalendarView);
            CopyToItem(objCopy);

            return (objCopy);
        }
Exemple #4
0
        private void SetNewDragItem(WeekDayView pv, CalendarItem view)
        {
            _LastBounds = pv._LastBounds;
            _LastMovePoint = pv._LastMovePoint;
            _LastPointOffset = pv._LastPointOffset;

            int dy = _LastPointOffset.Y - _LastBounds.Y;

            CalendarView.CalendarPanel.InternalMouseMove(new
                MouseEventArgs(MouseButtons.None, 0, view.Bounds.X, view.Bounds.Y + dy, 0));

            MouseEventArgs args = new
                MouseEventArgs(MouseButtons.Left, 1, view.Bounds.X, view.Bounds.Y + dy, 0);

            IsMoving = true;

            InternalMouseMove(args);
            CalendarView.CalendarPanel.InternalMouseDown(args);

            SelectedItem = view;

            IsCopyDrag = true;
        }
Exemple #5
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);
        }
Exemple #6
0
        private bool DragCustomItem(WeekDayView pv, CustomCalendarItem ci)
        {
            // Set the new owner and selected view, and
            // recalc the new layout

            if (ci.BaseCalendarItem != null)
                ci = ci.BaseCalendarItem;

            ci.OwnerKey = OwnerKey;

            if (NumberOfColumns > 1)
            {
                DateTime sd = ci.StartTime;
                TimeSpan ts = ci.EndTime.Subtract(ci.StartTime);

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

                ci.EndTime = ci.StartTime.Add(ts);
            }

            NeedRecalcLayout = true;
            RecalcSize();

            CalendarView.SelectedOwnerIndex = this.DisplayedOwnerKeyIndex;

            // Get the new view

            CustomCalendarItem view = GetCustomCalendarItem(ci);

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

            return (true);
        }