/// <summary>
        /// Gets the HitArea for MonthView items
        /// </summary>
        /// <param name="mv"></param>
        /// <param name="objArg"></param>
        /// <returns>eHitArea</returns>
        private eHitArea GetMonthHitArea(MonthView mv, MouseEventArgs objArg)
        {
            // Get what week this item is in, so we can
            // determine whether the item extends into either
            // the next or previous weeks

            MonthWeek monthWeek = mv.GetItemWeek(this);

            DateTime start = monthWeek.FirstDayOfWeek;
            DateTime end   = start.AddDays(7);

            // See if we are in the left resize area

            if (StartTime >= start && objArg.Location.X < Bounds.X + ResizeArea)
            {
                return(eHitArea.LeftResize);
            }

            // See if we are in the right resize area

            if (EndTime <= end && objArg.Location.X > Bounds.Right - ResizeArea)
            {
                return(eHitArea.RightResize);
            }

            // By default we are in the move area

            return(eHitArea.Move);
        }
Exemple #2
0
        private void AddCalendars()
        {
            monthView = new MonthView
            {
                Dock           = DockStyle.Fill,
                FirstDayOfWeek = DayOfWeek.Sunday,
                WorkWeekStart  = DayOfWeek.Monday,
                WorkWeekEnd    = DayOfWeek.Friday,
                SelectionMode  = MonthView.MonthViewSelection.WorkWeek,
                Anchor         = AnchorStyles.Top,
            };

            calendar = new Calendar
            {
                Dock           = DockStyle.Fill,
                FirstDayOfWeek = DayOfWeek.Sunday,
                //MaximumFullDays=14,
                //MaximumViewDays=14,
                ShowWeekHeader = true,
                TimeScale      = TimeScales.SixtyMinutes,
                //Padding=new Padding(4),
                RendererMode = RendererModes.Professional,
            };

            tabControlMain.TabPages[1].Controls["PanelOperationsLeft"].Controls.Add(monthView);
            tabControlMain.TabPages[1].Controls["PanelOperationsRight"].Controls.Add(calendar);
            tabControlMain.SelectTab(1);
        }
        internal MonthViewMonth(MonthView monthView, DateTime date)
        {
            if (date.Day != 1)
            {
                date = new DateTime(date.Year, date.Month, 1);
            }


            _monthview = monthView;
            _date      = date;

            int preDays = (new int[] { 0, 1, 2, 3, 4, 5, 6 })[(int)date.DayOfWeek] - (int)MonthView.FirstDayOfWeek;

            days = new MonthViewDay[6 * 7];
            DateTime curDate = date.AddDays(-preDays);

            DayHeaders = new string[7];

            for (int i = 0; i < days.Length; i++)
            {
                days[i] = new MonthViewDay(this, curDate);

                if (i < 7)
                {
                    DayHeaders[i] = curDate.ToString(MonthView.DayNamesFormat).Substring(0, MonthView.DayNamesLength);
                }

                curDate = curDate.AddDays(1);
            }
        }
        /// <summary>
        /// Gets the 'HitArea' for the item
        /// </summary>
        /// <param name="objArg"></param>
        /// <returns>eHitArea (move, resize, etc)</returns>
        private eHitArea GetHitArea(MouseEventArgs objArg)
        {
            // WeekDayView item

            WeekDayView wv = this.Parent as WeekDayView;

            if (wv != null)
            {
                return(GetWeekDayHitArea(objArg));
            }

            // MonthView item

            MonthView mv = this.Parent as MonthView;

            if (mv != null)
            {
                return(GetMonthHitArea(mv, objArg));
            }

            // TimeLineView item

            TimeLineView tv = this.Parent as TimeLineView;

            if (tv != null)
            {
                return(GetTimeLineHitArea(objArg));
            }

            // Nowhere we recognize

            return(eHitArea.None);
        }
Exemple #5
0
        internal CalendarDay(MonthView owningMonthView, DateTime date, bool belongsToCurrentMonth)
        {
            this.date = date;
            this.belongsToCurrentMonth = belongsToCurrentMonth;
            this.owningMonthView       = owningMonthView;

            this.Appointments = new ReadOnlyObservableCollection <CalendarAppointmentWrapper>(this.localAppointments);
        }
        /// <summary>
        /// Destroys the item.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="position">The position.</param>
        /// <param name="object">The object.</param>
        public override void DestroyItem(Android.Views.View container, int position, Java.Lang.Object @object)
        {
            //activePickerViews[position].OnDateSelected -= HandleOnDateSelected;
            //activePickerViews.Remove(position);
            var monthView = @object.JavaCast <MonthView>();

            (container.JavaCast <Android.Support.V4.View.ViewPager>()).RemoveView(monthView);
            _reusableMonthView = monthView;
            _activeMonthViews.Remove(position);
        }
Exemple #7
0
 private void hyperLinkEditReset_OpenLink(object sender, DevExpress.XtraEditors.Controls.OpenLinkEventArgs e)
 {
     if (Utilities.Instance.ShowWarningQuestion("Are you sure want to reset data?") == DialogResult.Yes)
     {
         ((AdCalendar)CalendarData).ResetToDefault();
         MonthView.RefreshData();
         SlideInfo.LoadData(allowToSave: false);
     }
     e.Handled = true;
 }
 private void CreateMonthView()
 {
     if (monthView == null)
     {
         monthView                         = new MonthView();
         monthView.Visibility              = Visibility.Hidden;
         monthView.OnZoomInEvent          += monthView_OnZoomInEvent;
         monthView.OnOpenDetailsEvent     += monthView_OnOpenDetailsEvent;
         monthView.OnBeginEditEvent       += monthView_OnBeginEditEvent;
         monthView.OnEndEditEvent         += monthView_OnEndEditEvent;
         monthView.OnSelectedChangedEvent += monthView_OnSelectedChangedEvent;
         monthView.OnExportEvent          += monthView_OnExportEvent;
         monthView.ReminderChanged        += monthView_ReminderChanged;
         calendarGrid.Children.Add(monthView);
     }
 }
Exemple #9
0
        /// <summary>
        /// Configure views
        /// </summary>
        /// <param name="scheduler">scheduler</param>
        /// <param name="cars">cars</param>
        protected void _ConfigureViews(DHXScheduler scheduler, IEnumerable cars)
        {
            scheduler.Views.Clear();

            //create TimeLines views
            scheduler.Views.Add(CreateDayTimeline(cars));
            scheduler.Views.Add(CreateWeekTimeline(cars));
            scheduler.Views.Add(CreateTwoWeeksTimeline(cars));

            // create MonthView
            var month = new MonthView();

            month.TabStyle = "left: 181px;";
            month.TabClass = "dhx_cal_tab_last";
            scheduler.Views.Add(month);

            scheduler.InitialView = scheduler.Views[0].Name;
        }
        /// <summary>
        /// Instantiates the item.
        /// </summary>
        /// <param name="container">The container.</param>
        /// <param name="position">The position.</param>
        /// <returns>Java.Lang.Object.</returns>
        public override Java.Lang.Object InstantiateItem(Android.Views.View container, int position)
        {
            Java.Lang.Object obj = container;
            var       pager      = obj.JavaCast <Android.Support.V4.View.ViewPager>();
            MonthView monthView  = null;

            if (_reusableMonthView == null)
            {
                monthView = MonthView.Create(pager, _inflater, _calendar.WeekdayNameFormat, _calendar.Today,
                                             _calendar.ClickHandler);
            }
            else
            {
                monthView          = _reusableMonthView;
                _reusableMonthView = null;
            }
            monthView.Init(_calendar.Months[position], _calendar.Cells[position]);
            //monthView.SetBackgroundColor(global::Android.Graphics.Color.Orange);

            pager.AddView(monthView);
            _activeMonthViews[position] = monthView;
            return(monthView);
        }
Exemple #11
0
        private void ToggleButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(PersianDateTextBox.Text.Trim()) == true)
            {
                PersianDateTextBox.Focus();

                return;
            }

            System.Text.RegularExpressions.Regex oRegex =
                new System.Text.RegularExpressions.Regex(AAk.Text.RegularExpressions.Patterns.PersianDate);

            if (oRegex.IsMatch(PersianDateTextBox.Text) == true)
            {
                AAk.Utils.PersianDate oPersianDate = new AAk.Utils.PersianDate(PersianDateTextBox.Text);

                MonthView.SelectedDateTime = oPersianDate;

                MonthView.GoToDate(oPersianDate);

                SelectedDateTime = AAk.Utils.PersianDateConverter.ToGregorianDateTime(oPersianDate);

                SelectedPersianDateTime = oPersianDate;

                DatePickerPopup.IsOpen = true;
            }
            else
            {
                MonthView.GoToDate(SelectedPersianDateTime);

                SelectedDateTime = AAk.Utils.PersianDateConverter.ToGregorianDateTime(AAk.Utils.PersianDate.Today);

                SelectedPersianDateTime = AAk.Utils.PersianDate.Today;
            }

            Text = PersianDateTextBox.Text;
        }
Exemple #12
0
 public override IViewProvider CreateAppointmentViewProvider(MonthView monthView)
 {
     return(new CustomAppointmentViewProvider());
 }
        private bool _IsConnected;          // Connection status

        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="model">Assoc CalendarModel</param>
        /// <param name="monthView">Assoc MonthView</param>
        public ModelMonthViewConnector(CalendarModel model, MonthView monthView)
        {
            _Model = model;
            _View = monthView;
        }
Exemple #14
0
 public CalendarAppointmentWrapper(MonthView owningMonthView, CalendarAppointment originalAppointment)
 {
     this.originalAppointment = originalAppointment;
     this.owningMonthView     = owningMonthView;
 }
Exemple #15
0
        private void BtnMonthView_Click(object sender, EventArgs e)
        {
            MonthView f = new MonthView();

            f.Show(this);
        }
Exemple #16
0
 internal MonthViewDay(MonthViewMonth month, DateTime date)
 {
     _month     = month;
     _monthView = month.MonthView;
     _date      = date;
 }
 internal MonthViewDay(MonthViewMonth month, DateTime date)
 {
     _month = month;
     _monthView = month.MonthView;
     _date = date;
 }
 public MonthView()
 {
     InitializeComponent();
     CurrentPage = this;
     addFirstThreePivots();
 }
Exemple #19
0
        void CheckDemo()
        {
            MonthView monthViewModule  = (MonthView)DemoBaseTesting.CurrentDemoModule;
            int       initialWeekCount = 5;

            Assert.AreEqual(SchedulerViewType.Month, monthViewModule.scheduler.ActiveViewType);
            Assert.AreEqual(initialWeekCount, monthViewModule.scheduler.MonthView.WeekCount);

            for (int i = initialWeekCount + 1; i <= 10; i++)
            {
                monthViewModule.spnWeekCount.SpinUp();
                UpdateLayoutAndDoEvents();
                Assert.AreEqual(false, monthViewModule.spnWeekCount.HasValidationError);
                Assert.AreEqual(i, monthViewModule.scheduler.MonthView.WeekCount);
            }

            Assert.AreEqual(DevExpress.XtraScheduler.FirstDayOfWeek.System, monthViewModule.scheduler.OptionsView.FirstDayOfWeek);

            for (int i = 0; i <= 7; i++)
            {
                monthViewModule.cbFirstDayOfWeek.SelectedItem = (DevExpress.XtraScheduler.FirstDayOfWeek)i;
                UpdateLayoutAndDoEvents();
                Assert.AreEqual(false, monthViewModule.cbFirstDayOfWeek.HasValidationError);
                Assert.AreEqual((DevExpress.XtraScheduler.FirstDayOfWeek)i, monthViewModule.scheduler.OptionsView.FirstDayOfWeek);
            }

            Assert.AreEqual(false, monthViewModule.chCompressWeekend.IsChecked);
            Assert.AreEqual(false, monthViewModule.scheduler.MonthView.CompressWeekend);
            monthViewModule.chCompressWeekend.IsChecked = true;
            UpdateLayoutAndDoEvents();
            Assert.AreEqual(true, monthViewModule.scheduler.MonthView.CompressWeekend);

            Assert.AreEqual(true, monthViewModule.chCompressWeekend.IsChecked);
            Assert.AreEqual(true, monthViewModule.scheduler.MonthView.CompressWeekend);
            monthViewModule.chCompressWeekend.IsChecked = false;
            UpdateLayoutAndDoEvents();
            Assert.AreEqual(false, monthViewModule.scheduler.MonthView.CompressWeekend);


            Assert.AreEqual(true, monthViewModule.scheduler.MonthView.ShowWeekend);
            Assert.AreEqual(true, monthViewModule.chShowWeekend.IsChecked);
            monthViewModule.chShowWeekend.IsChecked = false;
            UpdateLayoutAndDoEvents();
            Assert.AreEqual(false, monthViewModule.scheduler.MonthView.ShowWeekend);

            Assert.AreEqual(false, monthViewModule.chShowRecurrence.IsChecked);
            Assert.AreEqual(false, monthViewModule.scheduler.MonthView.AppointmentDisplayOptions.ShowRecurrence);
            monthViewModule.chShowRecurrence.IsChecked = true;
            UpdateLayoutAndDoEvents();
            Assert.AreEqual(true, monthViewModule.scheduler.MonthView.AppointmentDisplayOptions.ShowRecurrence);

            for (int i = 0; i <= 2; i++)
            {
                monthViewModule.cbStatusDisplayType.SelectedItem = (AppointmentStatusDisplayType)i;
                UpdateLayoutAndDoEvents();
                Assert.AreEqual((AppointmentStatusDisplayType)i, monthViewModule.scheduler.MonthView.AppointmentDisplayOptions.StatusDisplayType);
            }

            for (int i = 0; i <= 2; i++)
            {
                monthViewModule.cbTimeDisplayType.SelectedItem = (AppointmentTimeDisplayType)i;
                UpdateLayoutAndDoEvents();
                Assert.AreEqual((AppointmentTimeDisplayType)i, monthViewModule.scheduler.MonthView.AppointmentDisplayOptions.TimeDisplayType);
            }

            for (int i = 0; i <= 2; i++)
            {
                monthViewModule.cbStartTimeVisibility.SelectedItem = (AppointmentTimeVisibility)i;
                UpdateLayoutAndDoEvents();
                Assert.AreEqual((AppointmentTimeVisibility)i, monthViewModule.scheduler.MonthView.AppointmentDisplayOptions.StartTimeVisibility);
            }

            for (int i = 0; i <= 2; i++)
            {
                monthViewModule.cbEndTimeVisibility.SelectedItem = (AppointmentTimeVisibility)i;
                UpdateLayoutAndDoEvents();
                Assert.AreEqual((AppointmentTimeVisibility)i, monthViewModule.scheduler.MonthView.AppointmentDisplayOptions.EndTimeVisibility);
            }
        }
Exemple #20
0
 public override IViewProvider CreateCellViewProvider(MonthView monthView)
 {
     return(new CustomCellViewProvider());
 }