Пример #1
0
 private void TrainingItemCreate(object[] itemInfo)
 {
     _isAdding = true;
     CalendarEventArgs e = new CalendarEventArgs((DateTime)itemInfo[1]);
     switch ((TrainingEvent)(itemInfo[0]))
     {
         case TrainingEvent.Season:
             if (NewSeasonButtonClick != null) NewSeasonButtonClick(this, e); break;
         case TrainingEvent.Macrocycle:
             if (NewMacrocycleButtonClick != null) NewMacrocycleButtonClick(this, e); break;
         case TrainingEvent.Mesocycle:
             if (NewMesocycleButtonClick != null) NewMesocycleButtonClick(this, e); break;
         case TrainingEvent.Microcycle:
             if (NewMicrocycleButtonClick != null) NewMicrocycleButtonClick(this, e); break;
         case TrainingEvent.TrainingSession:
             if (NewTrainingSessionButtonClick != null) NewTrainingSessionButtonClick(this, e); break;
     }
 }
Пример #2
0
 private void OnTrainingNoteDeleted(CalendarEventArgs e)
 {
     if (NoteDeleted != null)
     {
         NoteDeleted(this, e);
     }
 }
Пример #3
0
 private void onTrainingItemDelete(TrainingItem item)
 {
     CalendarEventArgs evt = new CalendarEventArgs(item);
     if (DeleteButtonClick != null) DeleteButtonClick(this, evt);
     _selectedItem = null;
 }
Пример #4
0
 private void onTrainingItemEdit(TrainingItem item)
 {
     CalendarEventArgs evt = new CalendarEventArgs(item);
     if (EditButtonClick != null) EditButtonClick(this, evt);
 }
Пример #5
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            e.Graphics.Clear(SystemColors.Window);

            CalendarEventArgs evt = new CalendarEventArgs(this, e.Graphics);

            _renderer.DrawSelectionButtons(this, e.Graphics);

            _renderer.DrawMonthCalendars(this, e.Graphics);

            _calendarArea = new Area(e.Graphics, new Rectangle(MonthCalendar.Size.Width + 16, 30, this.Width - 500, this.Height));
            _trainingInfo = new Area(e.Graphics, new Rectangle(this.Width - 290, 5, 280, 200), SystemColors.Info, SystemColors.ActiveBorder);

            _renderer.DrawDays(evt);

            // draw items
            List<TrainingItem> sessions = new List<TrainingItem>();
            foreach (TrainingItem item in _items)
            {
                if (ItemInSelection(item))
                {
                    evt.Item = item;
                    //if (item.Type == TrainingEvent.TrainingSession || item.Type == TrainingEvent.Other /* e.g. training session in another training plan */)
                    //{
                    //}
                    _renderer.DrawItem(evt, sessions);
                }
            }

            _renderer.DrawCuadroInfo(evt);

            try
            {
                _renderer.DrawOpciones(evt);
            }
            catch (Exception Exception) { MessageBox.Show(Exception.Message); }
        }