示例#1
0
        // Token: 0x06002FDC RID: 12252 RVA: 0x0011756C File Offset: 0x0011576C
        private static ExDateTime[] GetViewDaysForMonthlyView(ISessionContext sessionContext, ExDateTime start)
        {
            ExDateTime exDateTime;
            ExDateTime exDateTime2;

            DatePickerBase.GetVisibleDateRange(start, out exDateTime, out exDateTime2, sessionContext.TimeZone);
            ExDateTime[] array = new ExDateTime[42 - exDateTime2.Day / 7 * 7];
            for (int i = 0; i < array.Length; i++)
            {
                array[i] = exDateTime.IncrementDays(i);
            }
            return(array);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e)
        {
            base.OnElementChanged(e);
            Control.Gravity = GravityFlags.Center;
            this.Control.SetBackgroundColor(Android.Graphics.Color.Transparent);
            this.Control.SetPadding(20, 0, 0, 0);
            GradientDrawable gd      = new GradientDrawable();
            DatePickerBase   element = Element as DatePickerBase;

            this.Control.SetTextColor(element.TextColor.ToAndroid());
            if (!string.IsNullOrWhiteSpace(element.Placeholder))
            {
                Control.Text = element.Placeholder;
            }
            this.Control.TextChanged += (sender, arg) =>
            {
                var selectedDate = arg.Text.ToString();
                if (selectedDate == element.Placeholder)
                {
                    Control.Text = DateTime.Now.ToString("dd/MM/yyyy");
                }
            };
            if (e.NewElement != null)
            {
                var view = (DatePickerBase)Element;
                if (view.IsCurvedCornersEnabled)
                {
                    // creating gradient drawable for the curved background
                    var _gradientBackground = new GradientDrawable();
                    _gradientBackground.SetShape(ShapeType.Rectangle);
                    _gradientBackground.SetColor(view.BackgroundColor.ToAndroid());

                    // Thickness of the stroke line
                    _gradientBackground.SetStroke(view.BorderWidth, view.BorderColor.ToAndroid());

                    // Radius for the curves
                    _gradientBackground.SetCornerRadius(
                        DpToPixels(this.Context, view.CornerRadius));

                    // set the background of the
                    Control.SetBackground(_gradientBackground);
                }
                // Set padding for the internal text from border
                Control.SetPadding(
                    (int)DpToPixels(this.Context, Convert.ToSingle(12)), Control.PaddingTop,
                    (int)DpToPixels(this.Context, Convert.ToSingle(12)), Control.PaddingBottom);
            }
        }
示例#3
0
        public void GetFreeBusy()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "DatePickerEventHandler.GetFreeBusy");
            ExDateTime month = (ExDateTime)base.GetParameter("m");

            OwaStoreObjectId[] array;
            if (!base.IsParameterSet("fId"))
            {
                array = new OwaStoreObjectId[]
                {
                    base.UserContext.CalendarFolderOwaId
                };
            }
            else
            {
                array = (OwaStoreObjectId[])base.GetParameter("fId");
                if (array.Length > 5)
                {
                    throw new OwaInvalidRequestException("Too many folders");
                }
                if (array.Length == 0)
                {
                    throw new OwaInvalidRequestException("Must pass at least one folder id");
                }
            }
            ExDateTime exDateTime;
            ExDateTime arg;

            DatePickerBase.GetVisibleDateRange(month, out exDateTime, out arg, base.UserContext.TimeZone);
            Duration timeWindow = new Duration((DateTime)exDateTime, (DateTime)arg.IncrementDays(1));

            ExTraceGlobals.CalendarTracer.TraceDebug <ExDateTime, ExDateTime>((long)this.GetHashCode(), "Getting free/busy data from {0} to {1}", exDateTime, arg);
            string multiCalendarFreeBusyDataForDatePicker = Utilities.GetMultiCalendarFreeBusyDataForDatePicker(timeWindow, array, base.UserContext);

            this.Writer.Write("<div id=fb _m=\"");
            this.Writer.Write(month.Month);
            this.Writer.Write("\" _y=\"");
            this.Writer.Write(month.Year);
            this.Writer.Write("\">");
            Utilities.HtmlEncode(multiCalendarFreeBusyDataForDatePicker, this.Writer);
            this.Writer.Write("</div>");
        }
示例#4
0
        protected override void OnLoad(EventArgs e)
        {
            this.selectedDate = (this.startDateTime = Utilities.GetQueryStringParameterDateTime(base.Request, "sd", base.UserContext.TimeZone));
            this.endDateTime  = Utilities.GetQueryStringParameterDateTime(base.Request, "ed", base.UserContext.TimeZone);
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "fid", false);

            if (!string.IsNullOrEmpty(queryStringParameter))
            {
                this.folderId = OwaStoreObjectId.CreateFromString(queryStringParameter);
            }
            if (this.startDateTime < this.endDateTime)
            {
                this.meetingDuration = (int)(this.endDateTime - this.startDateTime).TotalMinutes;
            }
            DatePickerBase.GetVisibleDateRange(this.selectedDate, out this.startDateTime, out this.endDateTime, base.UserContext.TimeZone);
            if (this.selectedDate.TimeOfDay.TotalMinutes < (double)this.WorkingHours.GetWorkDayStartTime(this.selectedDate) || (double)this.WorkingHours.GetWorkDayEndTime(this.selectedDate) <= this.selectedDate.TimeOfDay.TotalMinutes || (double)this.WorkingHours.GetWorkDayEndTime(this.selectedDate) < this.selectedDate.TimeOfDay.TotalMinutes + (double)this.meetingDuration || this.ForceShowing24Hours)
            {
                this.show24Hours = true;
            }
            this.recipientWell = new CalendarItemRecipientWell();
        }