示例#1
0
        public void MouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            if (dayView.SelectedAppointmentIsNew)
            {
                dayView.RaiseNewAppointment();
            }

            if (dayView.CurrentlyEditing)
            {
                dayView.FinishEditing(false);
            }

            mode = GetMode(e);

            if (dayView.SelectedAppointment != null)
            {
                DateTime downPos = dayView.GetTimeAt(e.X, e.Y);
                // Calculate delta time between selection and clicked point
                delta = dayView.SelectedAppointment.StartDate - downPos;
            }
            else
            {
                delta = TimeSpan.Zero;
            }

            length = TimeSpan.Zero;
        }
        public void MouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            if (m_dayView.SelectedAppointmentIsNew)
            {
                m_dayView.RaiseNewAppointment();
            }
            else
            {
                m_dayView.RaiseSelectionChanged(new AppointmentEventArgs(m_dayView.SelectedAppointment));
            }

            if (m_dayView.CurrentlyEditing)
            {
                m_dayView.FinishEditing(false);
            }

            m_mode = GetMode(e.Location);

            if (m_mode != Mode.None)
            {
                // Calculate delta time between selection and clicked point
                if (m_dayView.SelectedAppointment != null)
                {
                    DateTime downPos = m_dayView.GetDateTimeAt(e.X, e.Y);
                    m_delta = m_dayView.SelectedAppointment.StartDate - downPos;
                }
                else
                {
                    m_delta = TimeSpan.Zero;
                }

                m_length        = TimeSpan.Zero;
                m_lastMouseMove = e.Location;
            }
        }