Пример #1
1
 private void InitializeComponent()
 {
     System.Windows.Forms.Calendar.CalendarHighlightRange calendarHighlightRange1 = new System.Windows.Forms.Calendar.CalendarHighlightRange();
     System.Windows.Forms.Calendar.CalendarHighlightRange calendarHighlightRange2 = new System.Windows.Forms.Calendar.CalendarHighlightRange();
     System.Windows.Forms.Calendar.CalendarHighlightRange calendarHighlightRange3 = new System.Windows.Forms.Calendar.CalendarHighlightRange();
     System.Windows.Forms.Calendar.CalendarHighlightRange calendarHighlightRange4 = new System.Windows.Forms.Calendar.CalendarHighlightRange();
     System.Windows.Forms.Calendar.CalendarHighlightRange calendarHighlightRange5 = new System.Windows.Forms.Calendar.CalendarHighlightRange();
     this.btDelete     = new System.Windows.Forms.Button();
     this.btAdd        = new System.Windows.Forms.Button();
     this.label1       = new System.Windows.Forms.Label();
     this.btReadWrite  = new System.Windows.Forms.Button();
     this.listEntries  = new System.Windows.Forms.ListBox();
     this.dateSelect   = new System.Windows.Forms.MonthCalendar();
     this.calendarView = new System.Windows.Forms.Calendar.Calendar();
     this.SuspendLayout();
     //
     // btDelete
     //
     this.btDelete.Location  = new System.Drawing.Point(259, 393);
     this.btDelete.Name      = "btDelete";
     this.btDelete.Size      = new System.Drawing.Size(51, 24);
     this.btDelete.TabIndex  = 15;
     this.btDelete.Text      = "Delete";
     this.btDelete.TextAlign = System.Drawing.ContentAlignment.TopCenter;
     this.btDelete.UseVisualStyleBackColor = true;
     //
     // btAdd
     //
     this.btAdd.Location  = new System.Drawing.Point(321, 393);
     this.btAdd.Name      = "btAdd";
     this.btAdd.Size      = new System.Drawing.Size(51, 24);
     this.btAdd.TabIndex  = 14;
     this.btAdd.Text      = "Add";
     this.btAdd.TextAlign = System.Drawing.ContentAlignment.TopCenter;
     this.btAdd.UseVisualStyleBackColor = true;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(18, 199);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(75, 13);
     this.label1.TabIndex = 13;
     this.label1.Text     = "Dates entries :";
     //
     // btReadWrite
     //
     this.btReadWrite.Location = new System.Drawing.Point(617, 389);
     this.btReadWrite.Name     = "btReadWrite";
     this.btReadWrite.Size     = new System.Drawing.Size(149, 35);
     this.btReadWrite.TabIndex = 12;
     this.btReadWrite.Text     = "Write && Read back";
     this.btReadWrite.UseVisualStyleBackColor = true;
     //
     // listEntries
     //
     this.listEntries.FormattingEnabled = true;
     this.listEntries.Location          = new System.Drawing.Point(18, 218);
     this.listEntries.Name     = "listEntries";
     this.listEntries.Size     = new System.Drawing.Size(227, 199);
     this.listEntries.TabIndex = 11;
     //
     // dateSelect
     //
     this.dateSelect.Location          = new System.Drawing.Point(18, 18);
     this.dateSelect.MaxSelectionCount = 1;
     this.dateSelect.Name     = "dateSelect";
     this.dateSelect.TabIndex = 10;
     //
     // calendarView
     //
     this.calendarView.Font            = new System.Drawing.Font("Segoe UI", 9F);
     calendarHighlightRange1.DayOfWeek = System.DayOfWeek.Monday;
     calendarHighlightRange1.EndTime   = System.TimeSpan.Parse("17:00:00");
     calendarHighlightRange1.StartTime = System.TimeSpan.Parse("08:00:00");
     calendarHighlightRange2.DayOfWeek = System.DayOfWeek.Tuesday;
     calendarHighlightRange2.EndTime   = System.TimeSpan.Parse("17:00:00");
     calendarHighlightRange2.StartTime = System.TimeSpan.Parse("08:00:00");
     calendarHighlightRange3.DayOfWeek = System.DayOfWeek.Wednesday;
     calendarHighlightRange3.EndTime   = System.TimeSpan.Parse("17:00:00");
     calendarHighlightRange3.StartTime = System.TimeSpan.Parse("08:00:00");
     calendarHighlightRange4.DayOfWeek = System.DayOfWeek.Thursday;
     calendarHighlightRange4.EndTime   = System.TimeSpan.Parse("17:00:00");
     calendarHighlightRange4.StartTime = System.TimeSpan.Parse("08:00:00");
     calendarHighlightRange5.DayOfWeek = System.DayOfWeek.Friday;
     calendarHighlightRange5.EndTime   = System.TimeSpan.Parse("17:00:00");
     calendarHighlightRange5.StartTime = System.TimeSpan.Parse("08:00:00");
     this.calendarView.HighlightRanges = new System.Windows.Forms.Calendar.CalendarHighlightRange[] {
         calendarHighlightRange1,
         calendarHighlightRange2,
         calendarHighlightRange3,
         calendarHighlightRange4,
         calendarHighlightRange5
     };
     this.calendarView.Location = new System.Drawing.Point(259, 18);
     this.calendarView.Name     = "calendarView";
     this.calendarView.Size     = new System.Drawing.Size(526, 365);
     this.calendarView.TabIndex = 9;
     this.calendarView.Text     = "calendar1";
     //
     // CalendarEditor
     //
     this.ClientSize = new System.Drawing.Size(790, 431);
     this.Controls.Add(this.btDelete);
     this.Controls.Add(this.btAdd);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.btReadWrite);
     this.Controls.Add(this.listEntries);
     this.Controls.Add(this.dateSelect);
     this.Controls.Add(this.calendarView);
     this.Name = "CalendarEditor";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Пример #2
0
 /// <summary>
 /// Creates a new <see cref="CalendarRendererEventArgs"/>
 /// </summary>
 /// <param name="calendar">Calendar where painting</param>
 /// <param name="g">Device where to paint</param>
 /// <param name="clip">Paint event clip area</param>
 public CalendarRendererEventArgs(Calendar calendar, Graphics g, Rectangle clipRectangle, object tag)
 {
     _calendar = calendar;
     _graphics = g;
     _clip = clipRectangle;
     _tag = tag;
 }
Пример #3
0
 /// <summary>
 /// Copies the parameters from the specified <see cref="CalendarRendererEventArgs"/>
 /// </summary>
 /// <param name="original"></param>
 public CalendarRendererEventArgs(CalendarRendererEventArgs original)
 {
     _calendar = original.Calendar;
     _graphics = original.Graphics;
     _clip = original.ClipRectangle;
     _tag = original.Tag;
 }
Пример #4
0
 /// <summary>
 /// Creates a new item with the specified date range and text
 /// </summary>
 /// <param name="calendar">Calendar to reference item</param>
 /// <param name="startDate">Start date of the item</param>
 /// <param name="endDate">End date of the item</param>
 /// <param name="text">Text of the item</param>
 public CalendarItem(Calendar calendar, DateTime startDate, DateTime endDate, string text)
     : this(calendar)
 {
     StartDate = startDate;
     EndDate = endDate;
     Text = text;
 }
Пример #5
0
        /// <summary>
        /// Creates a new Day
        /// </summary>
        /// <param name="calendar">Calendar this day belongs to</param>
        /// <param name="date">Date of the day</param>
        /// <param name="index">Index of the day on the current calendar's view</param>
        internal CalendarDay(Calendar calendar, DateTime date, int index)
            : base(calendar)
        {
            _containedItems = new List<CalendarItem>();
            _calendar = calendar;
            _dayTop = new CalendarDayTop(this);
            _date = date;
            _index = index;

            UpdateUnits();
        }
Пример #6
0
 /// <summary>
 /// Creates a new Item that belongs to the specified calendar
 /// </summary>
 /// <param name="calendar">Calendar to reference item</param>
 public CalendarItem(Calendar calendar)
     : base(calendar)
 {
     _unitsPassing = new List<CalendarTimeScaleUnit>();
     _topsPassing = new List<CalendarDayTop>();
     _backgroundColor = Color.Empty;
     _borderColor = Color.Empty;
     _oreColor = Color.Empty;
     _backgroundColorLighter = Color.Empty;
     _imageAlign = CalendarItemImageAlign.West;
 }
        public CalendarView()
        {
            InitializeComponent();

            Calendar = calendar;
            _calendarViewController  = new CalendarViewController(this);
            calendar.MaximumViewDays = 140;
            ShowWeekView();
            monthView.FirstDayOfWeek = DayOfWeek.Monday;
            SetWeekLabel();
            SetMonthLabel();
            SetYearLabel();
        }
        /// <summary>
        /// Creates a new renderer for the specified calendar
        /// </summary>
        /// <param name="calendar"></param>
        public CalendarRenderer(Calendar calendar)
        {
            if (calendar == null)
            {
                throw new ArgumentNullException("calendar");
            }

            _calendar = calendar;
            _allDayItemsPadding = 5;
            _itemsPadding = 5;
            _itemTextMargin = new Padding(3);
            _itemShadowPadding = 4;
            _itemInvalidateMargin = 0;
        }
Пример #9
0
        /// <summary>
        /// Creates new instance of GoogleCalendarSynchronizer class
        /// </summary>
        /// <param name="calendar">System.Windows.Forms.Calendar calendar</param>
        /// <param name="userName">User name for Google Calendar API</param>
        /// <param name="calendarID">Google calendar ID</param>
        public GoogleCalendarSynchronizer(System.Windows.Forms.Calendar.Calendar calendar, string userName, string calendarID = null)
        {
            this.calendar   = calendar;
            this.userName   = userName;
            this.calendarID = calendarID ?? "primary";

            try
            {
                service = GetGoogleService();
            }
            catch (Exception ex)
            {
                BasicMessagesHandler.ShowErrorMessage("Nepodarilo sa vytvoriť Google Calendar Service", ex);
            }
        }
Пример #10
0
        public CalendarView()
        {
            InitializeComponent();

            StartPosition = FormStartPosition.CenterScreen;

            contextMenuStrip1.Items.Add("Deaktiver");



            Calendar = calendar;
            _calendarViewController = new CalendarViewController(this);

            _currentVisibleAppointments = _calendarViewController.GetAppointments();
            SetupCalendar();
        }
Пример #11
0
        public CalendarProfessionalRenderer(Calendar c)
            : base(c)
        {
            
            ColorTable.Background = FromHex("#E3EFFF");
            ColorTable.DayBackgroundEven = FromHex("#A5BFE1");
            ColorTable.DayBackgroundOdd = FromHex("#FFFFFF");
            ColorTable.DayBackgroundSelected = FromHex("#E6EDF7");
            ColorTable.DayBorder = FromHex("#5D8CC9");
            ColorTable.DayHeaderBackground = FromHex("#DFE8F5");
            ColorTable.DayHeaderText = Color.Black;
            ColorTable.DayHeaderSecondaryText = Color.Black;
            ColorTable.DayTopBorder = FromHex("#5D8CC9");
            ColorTable.DayTopSelectedBorder = FromHex("#5D8CC9");
            ColorTable.DayTopBackground = FromHex("#A5BFE1");
            ColorTable.DayTopSelectedBackground = FromHex("#294C7A");
            ColorTable.ItemBorder = FromHex("#5D8CC9");
            ColorTable.ItemBackground = FromHex("#C0D3EA");
            ColorTable.ItemText = Color.Black;
            ColorTable.ItemSecondaryText = FromHex("#294C7A");
            ColorTable.ItemSelectedBorder = Color.Black;
            ColorTable.ItemSelectedBackground = FromHex("#C0D3EA");
            ColorTable.ItemSelectedText = Color.Black;
            ColorTable.WeekHeaderBackground = FromHex("#DFE8F5");
            ColorTable.WeekHeaderBorder = FromHex("#5D8CC9");
            ColorTable.WeekHeaderText = FromHex("#5D8CC9");
            ColorTable.TodayBorder = FromHex("#EE9311");
            ColorTable.TodayTopBackground = FromHex("#EE9311");
            ColorTable.TimeScaleLine = FromHex("#6593CF");
            ColorTable.TimeScaleHours = FromHex("#6593CF");
            ColorTable.TimeScaleMinutes = FromHex("#6593CF");
            ColorTable.TimeUnitBackground = FromHex("#E6EDF7");
            ColorTable.TimeUnitHighlightedBackground = Color.White;
            ColorTable.TimeUnitSelectedBackground = FromHex("#294C7A");
            ColorTable.TimeUnitBorderLight = FromHex("#D5E1F1");
            ColorTable.TimeUnitBorderDark = FromHex("#A5BFE1");
            ColorTable.WeekDayName = FromHex("#6593CF");

            SelectedItemBorder = 2f;
            ItemRoundness = 5;
        }
Пример #12
0
 public CalendarSystemRenderer(Calendar calendar)
     : base(calendar)
 {
     ColorTable = new CalendarColorTable();
     SelectedItemBorder = 1;
 }
Пример #13
0
 /// <summary>
 /// Creates a new week for the specified calendar
 /// </summary>
 /// <param name="calendar">Calendar this week belongs to</param>
 /// <param name="sunday">Start day of the week</param>
 internal CalendarWeek(Calendar calendar, DateTime firstDay)
 {
     _calendar = calendar;
     _firstDay = firstDay;
 }
Пример #14
0
 /// <summary>
 /// Creates a new <see cref="CalendarTextBox"/> for the specified <see cref="Calendar"/>
 /// </summary>
 /// <param name="calendar">Calendar where this control lives</param>
 public CalendarTextBox(Calendar calendar)
 {
     _calendar = calendar;
 }
 public CalendarLoadEventArgs(Calendar calendar, DateTime dateStart, DateTime dateEnd)
 {
     _calendar = calendar;
     _dateEnd = dateEnd;
     _dateStart = dateStart;
 }
Пример #16
0
 /// <summary>
 /// Creates a new item with the specified date, duration and text
 /// </summary>
 /// <param name="calendar">Calendar to reference item</param>
 /// <param name="startDate">Start date of the item</param>
 /// <param name="duration">Duration of the item</param>
 /// <param name="text">Text of the item</param>
 public CalendarItem(Calendar calendar, DateTime startDate, TimeSpan duration, string text)
     : this(calendar, startDate, startDate.Add(duration), text)
 { }
Пример #17
0
 /// <summary>
 /// Sets the value of the <see cref="Calendar"/> property
 /// </summary>
 /// <param name="calendar">Calendar that this range belongs to</param>
 internal void SetCalendar(Calendar calendar)
 {
     _calendar = calendar;
 }
Пример #18
0
 /// <summary>
 /// Creates a new <see cref="CalendarRendererEventArgs"/>
 /// </summary>
 /// <param name="calendar">Calendar where painting</param>
 /// <param name="g">Device where to paint</param>
 /// <param name="clip">Paint event clip area</param>
 public CalendarRendererEventArgs(Calendar calendar, Graphics g, Rectangle clipRectangle)
 {
     _calendar = calendar;
     _graphics = g;
     _clip = clipRectangle;
 }
Пример #19
0
        /// <summary>
        /// Creates a new Element
        /// </summary>
        /// <param name="calendar"></param>
        public CalendarSelectableElement(Calendar calendar)
        {
            if (calendar == null) throw new ArgumentNullException("calendar");

            _calendar = calendar;
        }