private void DayBox_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            try
            {
                //-- call to FindVisualAncestor to make sure they didn't click on existing appointment (in which case,
                //   that appointment window is already opened by handler Appointment_DoubleClick)

                if (object.ReferenceEquals(e.Source.GetType(), typeof(DayBoxControl)) && Utilities.FindVisualAncestor(typeof(DayBoxAppointmentControl), e.OriginalSource) == null)
                {
                    NewAppointmentEventArgs ev = new NewAppointmentEventArgs();
                    if (((DayBoxControl)e.Source).Tag != null)
                    {
                        ev.StartDate = new System.DateTime(displayYear, displayMonth, Convert.ToInt32(((DayBoxControl)e.Source).Tag), 10, 0, 0);
                        ev.EndDate   = Convert.ToDateTime(ev.StartDate).AddHours(2);
                    }
                    if (DayBoxDoubleClicked != null)
                    {
                        DayBoxDoubleClicked(ev);
                    }
                    e.Handled = true;
                }
            }
            catch (Exception ex)
            {
                LogExceptions.LogException(ex);
            }
        }
        private void DayBoxDoubleClicked_event(NewAppointmentEventArgs e)
        {
            CalendarEditWin dlg = new CalendarEditWin(date: Convert.ToDateTime(e.StartDate));

            dlg.ShowDialog();
            SetAppointments(TabsMain.SelectedIndex);
            //MessageBox.Show("You double-clicked on day " + Convert.ToDateTime(e.StartDate).ToShortDateString(), "Calendar Event", MessageBoxButton.OK);
        }
Example #3
0
        private void dvOnline_OnNewAppointment(object sender, NewAppointmentEventArgs e)
        {
            HiveDowntime downtime = new HiveDowntime();

            downtime.StartDate = e.StartDate;
            downtime.EndDate   = e.EndDate;
            offlineTimes.Add(downtime);
        }
Example #4
0
        void dayView1_NewAppointment(object sender, NewAppointmentEventArgs args)
        {
            var newAppointment = new Appointment {
                StartDate = args.StartDate, EndDate = args.EndDate, Subject = args.Title, Group = "2"
            };

            _appointments.Add(newAppointment);
        }
Example #5
0
        private void DayBoxDoubleClicked_event(NewAppointmentEventArgs e)
        {
            // open day view
            Grid       g2 = (Grid)(this.Parent);
            MainWindow w  = (MainWindow)(g2.Parent);

            w.MonthViewToDayView(e.StartDate.GetValueOrDefault());
        }
Example #6
0
        private void dayView2_NewAppointment(object sender, NewAppointmentEventArgs args)
        {
            AgendamentoDTO m_Appointment = new AgendamentoDTO();

            m_Appointment.StartDate = args.StartDate;
            m_Appointment.EndDate   = args.EndDate;
            m_Appointment.Title     = args.Title;
            m_Appointments2.Add(m_Appointment);
        }
Example #7
0
        void dayView1_NewAppointment(object sender, NewAppointmentEventArgs args)
        {
            Appointment m_Appointment = new Appointment();

            m_Appointment.StartDate = args.StartDate;
            m_Appointment.EndDate   = args.EndDate;
            m_Appointment.Title     = args.Title;
            m_Appointments.Add(m_Appointment);
        }
Example #8
0
        private void AptCalendar_DayBoxDoubleClicked(object sender, RoutedEventArgs e)
        {
            //MessageBox.Show("AptCalendar_DayBoxDoubleClicked");
            //new appointment
            NewAppointmentEventArgs aea = e as NewAppointmentEventArgs;

            AppointmentEditForm ef = new AppointmentEditForm();
            Appointment         ap = new Appointment();

            ap.ApDate      = aea.StartDate;
            ef.DataContext = ap;
            ef.ShowDialog();
            Changed();
        }
Example #9
0
        private void DayBox_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            // -- call to FindVisualAncestor to make sure they didn't click on existing appointment (in which case,
            // that appointment window is already opened by handler Appointment_DoubleClick)
            if (e.Source.GetType() == typeof(DayBoxControl) && Utilities.FindVisualAncestor(typeof(DayBoxAppointmentControl), e.OriginalSource as Visual) == null)
            {
                NewAppointmentEventArgs ev = new NewAppointmentEventArgs();
                if ((DayBoxControl)e.Source != null)                                                                                             //Tag
                {
                    ev.StartDate = new DateTime(_DisplayYear, _DisplayMonth, System.Convert.ToInt32(((DayBoxControl)e.Source).m_day), 10, 0, 0); //Tag
                    ev.EndDate   = (DateTime)ev.StartDate.Value.AddHours(2);
                }

                DayBoxDoubleClicked?.Invoke(ev);
                e.Handled = true;
            }
        }
 private void DayView1_NewAppointment(object sender, NewAppointmentEventArgs args)
 {
     try
     {
         Appointment m_App = new Appointment
         {
             StartDate   = dayView1.SelectionStart,
             EndDate     = dayView1.SelectionEnd,
             BorderColor = Color.Red,
             Color       = Color.White
         };
         m_Appointments.Add(m_App);
     }
     catch (Exception ex)
     {
         Log.AppendOnFile("E", "Error on new appointment:{0}", ex.Message);
         if (ex.InnerException != null)
         {
             Log.AppendOnFile("E", "Inner Exception:{0}", ex.InnerException.Message);
         }
     }
 }
 public EventWindow(Calendar c, NewAppointmentEventArgs d)
 {
     cal    = c;
     this.d = d;
     InitializeComponent();
 }
Example #12
0
 private void DayDoubleClicked(NewAppointmentEventArgs e)
 {
     MessageBox.Show("You double-clicked on day " + Convert.ToDateTime(e.StartDate).ToShortDateString(), "Calendar Event", MessageBoxButton.OK);
 }
Example #13
0
        /*
         * This method is activated when a user double clicks on a date in the calendar
         * This opens up the window to create a new event
         *
         * */
        private void DayBoxDoubleClicked_event(NewAppointmentEventArgs e)
        {
            EventWindow ew = new EventWindow(this, e);

            ew.Show();
        }