Example #1
0
 private void fullCalendar1_EventDoubleClick(object sender, EventClickEventArgs e)
 {
     // edit the event
     using (EventEditor editor = new EventEditor())
     {
         editor.eventEntry = e.Event;
         editor.ShowDialog(this.FindForm());
     }
 }
Example #2
0
        private void toolBar1_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
        {
            if (e.Button == this.tbNew)
            {
                // create an empty event
                Wisej.Web.Ext.FullCalendar.Event ev = new Event();
                ev.Start = DateTime.Now;
                ev.End   = DateTime.Now.AddHours(0.5);

                // show the editor
                using (EventEditor editor = new EventEditor())
                {
                    editor.eventEntry = ev;
                    if (editor.ShowDialog(this.FindForm()) == DialogResult.OK)
                    {
                        this.fullCalendar1.Events.Add(ev);
                    }
                }

                return;
            }

            if (e.Button.Tag != null)
            {
                foreach (ToolBarButton button in this.toolBar1.Buttons)
                {
                    button.Pushed = false;
                }

                e.Button.Pushed = true;

                // change the calendar view
                ViewType calendarView;
                if (Enum.TryParse(e.Button.Tag.ToString(), out calendarView))
                {
                    this.fullCalendar1.View = calendarView;
                }
            }
        }