Beispiel #1
0
        public void DeleteAppointment(Appointment apt)
        {
            BindingList <ListViewAppointment> dataSource;
            ListViewAppointment result = FindRow(apt, out dataSource);

            if (result != null)
            {
                dataSource.Remove(result);
            }
        }
Beispiel #2
0
        private void gridViewAppointments_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
        {
            GridView currentView = sender as GridView;

            if (!currentView.IsGroupRow(e.RowHandle))
            {
                ListViewAppointment currentAppointment = (sender as GridView).GetRow(e.RowHandle) as ListViewAppointment;
                e.Appearance.BackColor = currentAppointment.ListViewLabel;
            }
        }
Beispiel #3
0
        private void gridViewAppointments_DoubleClick(object sender, EventArgs e)
        {
            GridView currentView = sender as GridView;

            if (!currentView.IsGroupRow(currentView.FocusedRowHandle))
            {
                ListViewMenuBuilder.Scheduler = OwnerScheduler;
                ListViewAppointment listViewAppointment = currentView.GetRow(currentView.FocusedRowHandle) as ListViewAppointment;
                ListViewMenuBuilder.CurrentAppointment = listViewAppointment.SourceAppointment;
                ListViewMenuBuilder.ViewControl        = this;
                ListViewMenuBuilder.OnOpenCurrentAppointment(null, null);
            }
        }
Beispiel #4
0
        private void gridViewAppointments_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            GridView view = sender as GridView;

            if (e.RowHandle == view.FocusedRowHandle)
            {
                if (!view.IsGroupRow(e.RowHandle))
                {
                    ListViewAppointment currentAppointment = (sender as GridView).GetRow(e.RowHandle) as ListViewAppointment;
                    e.Appearance.BackColor = GetLightenColor(currentAppointment.ListViewLabel, 0.1);
                }
            }
        }
        public static ListViewAppointment CreateListViewAppointment(AppointmentStorage storage, Appointment sourceAppointment, DayOfWeek dayOfWeek)
        {
            ListViewAppointment listViewAppointment = new ListViewAppointment();

            listViewAppointment.ListViewDate = sourceAppointment.Start;

            listViewAppointment.ListViewSubject           = sourceAppointment.Subject;
            listViewAppointment.ListViewRecurrencePattern = RecurrenceInfo.GetDescription(sourceAppointment, dayOfWeek);
            listViewAppointment.ListViewIsRecurring       = sourceAppointment.IsRecurring;
            listViewAppointment.ListViewDuration          = sourceAppointment.Duration.ToString();
            listViewAppointment.ListViewAppointmentID     = sourceAppointment.Id;
            listViewAppointment.ListViewLocation          = sourceAppointment.Location;
            listViewAppointment.ListViewStatus            = storage.Statuses[sourceAppointment.StatusId];;
            listViewAppointment.ListViewLabel             = storage.Labels[sourceAppointment.LabelId].Color;
            listViewAppointment.SourceAppointment         = sourceAppointment;
            return(listViewAppointment);
        }
Beispiel #6
0
 private void gridViewAppointments_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell)
     {
         GridView            currentView       = sender as GridView;
         ListViewAppointment agendaAppointment = currentView.GetRow(e.HitInfo.RowHandle) as ListViewAppointment;
         ListViewMenuBuilder.GenerateContextMenu(this, e.Menu, OwnerScheduler, agendaAppointment.SourceAppointment);
     }
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.EmptyRow)
     {
         if (e.Menu == null)
         {
             e.Menu = new DevExpress.XtraGrid.Menu.GridViewMenu(sender as GridView);
         }
         ListViewMenuBuilder.GenerateContextMenu(this, e.Menu, OwnerScheduler, null);
     }
 }