Esempio n. 1
0
        public override View GetSampleContent(Context context)
        {
            con        = context;
            sfschedule = new SfSchedule(context);
            InitializingAppointmentData();
            sfschedule.ScheduleView         = ScheduleView.DayView;
            sfschedule.TimeIntervalHeight   = -1;
            sfschedule.VisibleDatesChanged += Sfschedule_VisibleDatesChanged;

            var dayViewSettings = new DayViewSettings();

            dayViewSettings.StartHour  = 9;
            dayViewSettings.EndHour    = 16;
            sfschedule.DayViewSettings = dayViewSettings;

            nonAccessibleBlocksCollection = new NonAccessibleBlocksCollection();
            var lunch = new NonAccessibleBlock();

            lunch.StartTime = 12;
            lunch.EndTime   = 13;
            lunch.Text      = "Lunch Break";
            nonAccessibleBlocksCollection.Add(lunch);
            nonAccessibleBlocks = nonAccessibleBlocksCollection;

            sfschedule.DayViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;

            LinearLayout layout = new LinearLayout(context);

            layout.Orientation = Android.Widget.Orientation.Vertical;
            layout.AddView(sfschedule);
            return(layout);
        }
Esempio n. 2
0
        private void SetNonWorkingHours()
        {
            daySettings      = new DayViewSettings();
            weekSettings     = new WeekViewSettings();
            workWeekSettings = new WorkWeekViewSettings();

            //Non-AccessbleBlocks
            NonAccessibleBlock lunch_hour = new NonAccessibleBlock();

            lunch_hour.StartHour = 13;
            lunch_hour.EndHour   = 14;
            lunch_hour.Text      = (NSString)"LUNCH";
            daySettings.NonAccessibleBlockCollection      = new NSMutableArray();
            weekSettings.NonAccessibleBlockCollection     = new NSMutableArray();
            workWeekSettings.NonAccessibleBlockCollection = new NSMutableArray();

            if (switchNonAccessbleBlock != null && switchNonAccessbleBlock.On)
            {
                daySettings.NonAccessibleBlockCollection.Add(lunch_hour);
                weekSettings.NonAccessibleBlockCollection.Add(lunch_hour);
                workWeekSettings.NonAccessibleBlockCollection.Add(lunch_hour);
            }

            schedule.DayViewSettings      = daySettings;
            schedule.WeekViewSettings     = weekSettings;
            schedule.WorkWeekViewSettings = workWeekSettings;
        }
        public Configurations()
        {
            InitializeComponent();

            if (Device.Idiom == TargetIdiom.Phone && Device.OS == TargetPlatform.Windows)
            {
                grid_layout.WidthRequest  = App.ScreenWidth;
                grid_layout.HeightRequest = App.ScreenHeight;
            }
            if (App.Platform == Platforms.UWP && Device.Idiom == TargetIdiom.Desktop)
            {
                Schedule.HeaderHeight = 40;
            }
            if (Device.Idiom == TargetIdiom.Tablet && Device.OS == TargetPlatform.Android)
            {
                Schedule.ViewHeaderHeight = 35;
            }

            InitializingConfigurationSettings();
            CreateConfigurationSettingsLayout();

            DayViewSettings dayViewSettings = new DayViewSettings();

            dayViewSettings.WorkStartHour = 7;
            dayViewSettings.WorkEndHour   = 18;
            Schedule.DayViewSettings      = dayViewSettings;
        }
        //Initializing ConfigurationSettings
        private void InitializingConfigurationSettings()
        {
            day_view_setting       = new DayViewSettings();
            week_view_setting      = new WeekViewSettings();
            work_week_view_setting = new WorkWeekViewSettings();
            month_view_setting     = new MonthViewSettings();

            NonAccessibleBlock nonAccessibleBlock = new NonAccessibleBlock();

            nonAccessibleBlock.StartTime = 13;
            nonAccessibleBlock.EndTime   = 14;
            nonAccessibleBlock.Text      = "Lunch Time";
            day_view_setting.NonAccessibleBlocks.Add(nonAccessibleBlock);
            week_view_setting.NonAccessibleBlocks.Add(nonAccessibleBlock);
            work_week_view_setting.NonAccessibleBlocks.Add(nonAccessibleBlock);
            month_view_setting.ShowWeekNumber = true;

            Schedule.DayViewSettings      = day_view_setting;
            Schedule.WeekViewSettings     = week_view_setting;
            Schedule.WorkWeekViewSettings = work_week_view_setting;

            month_view_setting.MonthLabelSettings = new MonthLabelSettings();
            Schedule.MonthViewSettings            = month_view_setting;

            List <DateTime> black_out_days = new List <DateTime>();

            for (int i = 0; i < count; i++)
            {
                DateTime date = DateTime.Now.Date.AddDays(i);
                black_out_days.Add(date);
            }
        }
Esempio n. 5
0
        private void SetDayLabelFormatToMinutes()
        {
            DayViewSettings = new DayViewSettings();
            DayLabelSettings dayLabelSettings = new DayLabelSettings();

            dayLabelSettings.TimeFormat      = "hh mm";
            DayViewSettings.DayLabelSettings = dayLabelSettings;
        }
Esempio n. 6
0
        public override View GetSampleContent(Context context)
        {
            this.mContext = context;
            LinearLayout linearLayout = new LinearLayout(context);

            linearLayout.Orientation = Orientation.Vertical;
            //creating instance for Schedule
            sfSchedule = new SfSchedule(context);
            HeaderStyle headerStyle = new HeaderStyle();

            headerStyle.BackgroundColor = Color.Argb(255, 214, 214, 214);
            headerStyle.TextColor       = Color.Black;

            ViewHeaderStyle viewHeader = new ViewHeaderStyle();

            viewHeader.BackgroundColor = Color.Argb(255, 28, 28, 28);
            viewHeader.DayTextColor    = Color.Argb(255, 238, 199, 43);
            viewHeader.DateTextColor   = Color.Argb(255, 238, 199, 43);

            sfSchedule.HeaderStyle = headerStyle;
            //sfSchedule.ViewHeaderStyle = viewHeader;

            DayViewSettings dayViewSettings = new DayViewSettings();

            dayViewSettings.TimeSlotBorderStrokeWidth          = 2;
            dayViewSettings.VerticalLineStrokeWidth            = 0;
            dayViewSettings.VerticalLineColor                  = Color.Transparent;
            dayViewSettings.TimeSlotBorderColor                = Color.LightGray;
            dayViewSettings.NonWorkingHoursTimeSlotBorderColor = Color.LightGray;
            sfSchedule.DayViewSettings = dayViewSettings;

            Button button = new Button(context);

            button.Text = "+ New event";
            button.SetTextColor(Color.White);
            button.Gravity = GravityFlags.Left;
            button.SetBackgroundColor(Color.Rgb(0, 122, 255));
            button.Click            += Button_Click;
            sfSchedule.SelectionView = button;

            //set the appointment collection
            getAppointments();
            sfSchedule.Appointments          = appointmentCollection;
            sfSchedule.AppointmentViewLayout = ViewLayoutOptions.Overlay;
            sfSchedule.MonthCellLoaded      += SfSchedule_MonthCellLoaded;
            sfSchedule.LayoutParameters      = new FrameLayout.LayoutParams(
                LinearLayout.LayoutParams.MatchParent,
                LinearLayout.LayoutParams.MatchParent);
            sfSchedule.AppointmentLoaded += SfSchedule_AppointmentLoaded;
            sfSchedule.CellTapped        += sfSchedule_ScheduleTapped;
            linearLayout.AddView(sfSchedule);
            return(linearLayout);
        }
Esempio n. 7
0
        public Timetable()
        {
            schedule = new SFSchedule();
            schedule.ScheduleView         = SFScheduleView.SFScheduleViewDay;
            schedule.TimeIntervalHeight   = -1;
            schedule.VisibleDatesChanged += Schedule_VisibleDatesChanged;
            InitializeAppointmentComponents();
            var dayViewSettings = new DayViewSettings();

            dayViewSettings.StartHour = 9;
            dayViewSettings.EndHour   = 16;
            schedule.DayViewSettings  = dayViewSettings;
            dayViewSettings.NonAccessibleBlockCollection = CreateNonAccescibleBlock();
            schedule.DayViewSettings = dayViewSettings;
            this.AddSubview(schedule);
        }
Esempio n. 8
0
        public Timetable()
        {
            schedule = new SFSchedule();
            schedule.ScheduleView = SFScheduleView.SFScheduleViewDay;
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                schedule.TimeIntervalHeight = 100;
            }
            else
            {
                schedule.TimeIntervalHeight = 130;
            }
            schedule.VisibleDatesChanged += Schedule_VisibleDatesChanged;
            InitializeAppointmentComponents();
            var dayViewSettings = new DayViewSettings();

            dayViewSettings.StartHour = 9;
            dayViewSettings.EndHour   = 16;
            schedule.DayViewSettings  = dayViewSettings;
            dayViewSettings.NonAccessibleBlockCollection = CreateNonAccescibleBlock();
            schedule.DayViewSettings = dayViewSettings;
            this.AddSubview(schedule);
        }
Esempio n. 9
0
        /// <summary>
        /// Sets the non accessible blocks.
        /// </summary>
        private void SetNonAccessibleBlocks()
        {
            if (Device.RuntimePlatform == "Android" || Device.RuntimePlatform == "iOS")
            {
                NonAccessibleBlocksCollection nonAccessibleBlocks = new NonAccessibleBlocksCollection();
                var nonAccessibleBlock = new NonAccessibleBlock();
                nonAccessibleBlock.StartTime = 13;
                nonAccessibleBlock.EndTime   = 14;
                nonAccessibleBlock.Text      = "Lunch time";
                nonAccessibleBlocks.Add(nonAccessibleBlock);

                var dayViewSettings = new DayViewSettings();
                dayViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;
                this.schedule.DayViewSettings       = dayViewSettings;

                var weekViewSettings = new WeekViewSettings();
                weekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;
                this.schedule.WeekViewSettings       = weekViewSettings;

                var workWeekViewSettings = new WorkWeekViewSettings();
                workWeekViewSettings.NonAccessibleBlocks = nonAccessibleBlocks;
                this.schedule.WorkWeekViewSettings       = workWeekViewSettings;
            }
        }
        protected override async void ViewIsAppearing(object sender, EventArgs e)
        {
            AfazerSelecionado = new Afazer();
            InicioData        = new DateTime();
            Afazeres          = new ObservableCollection <Afazer>();
            oHorario          = new PageModelHelper
            {
                ActivityRunning  = true,
                Visualizar       = false,
                DadoPaciente     = true,
                CuidadorExibicao = false
            };
            DataAfazeres           = new ScheduleAppointmentCollection();
            DataRealizacaoAfazeres = new CalendarEventCollection();
            ConfigExibDias         = new DayLabelSettings();
            ConfigDias             = new DayViewSettings {
                ShowAllDay = true,
            };
            await GetAfazeresConcluidos();
            await GetAfazeres();

            oHorario.ActivityRunning  = false;
            oHorario.CuidadorExibicao = true;
        }
Esempio n. 11
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (schedule != null)
                {
                    schedule.Dispose();
                    schedule = null;
                }

                if (OptionView != null)
                {
                    this.OptionView.RemoveFromSuperview();
                    this.OptionView.Dispose();
                    this.OptionView = null;
                }

                if (buttonScheduleView != null)
                {
                    buttonScheduleView.TouchUpInside -= ShowPicker1;
                    buttonScheduleView.Dispose();
                    buttonScheduleView = null;
                }

                if (doneButton != null)
                {
                    doneButton.TouchUpInside -= HidePicker;
                    doneButton.Dispose();
                    doneButton = null;
                }

                if (rangeslider != null)
                {
                    rangeslider.RangeValueChange -= Slider_RangeValueChange;
                    rangeslider.Dispose();
                    rangeslider = null;
                }

                if (daySettings != null)
                {
                    daySettings.Dispose();
                    daySettings = null;
                }

                if (labelBlackOutDays != null)
                {
                    labelBlackOutDays.Dispose();
                    labelBlackOutDays = null;
                }

                if (labelScheduleView != null)
                {
                    labelScheduleView.Dispose();
                    labelScheduleView = null;
                }

                if (labelShowNonAccess != null)
                {
                    labelShowNonAccess.Dispose();
                    labelShowNonAccess = null;
                }

                if (labelWeekNumber != null)
                {
                    labelWeekNumber.Dispose();
                    labelWeekNumber = null;
                }

                if (labelWorkingHours != null)
                {
                    labelWorkingHours.Dispose();
                    labelWorkingHours = null;
                }

                if (monthSettings != null)
                {
                    monthSettings.Dispose();
                    monthSettings = null;
                }

                if (pickerScheduleView != null)
                {
                    pickerScheduleView.Dispose();
                    pickerScheduleView = null;
                }

                if (switchBlackOutDates != null)
                {
                    switchBlackOutDates.Dispose();
                    switchBlackOutDates = null;
                }

                if (switchNonAccessbleBlock != null)
                {
                    switchNonAccessbleBlock.Dispose();
                    switchNonAccessbleBlock = null;
                }

                if (switchWeekNumber != null)
                {
                    switchWeekNumber.Dispose();
                    switchWeekNumber = null;
                }

                if (weekSettings != null)
                {
                    weekSettings.Dispose();
                    weekSettings = null;
                }

                if (workWeekSettings != null)
                {
                    workWeekSettings.Dispose();
                    workWeekSettings = null;
                }
            }

            base.Dispose(disposing);
        }
Esempio n. 12
0
        public Schedule_View()
        {
            InitializeComponent();

            if (Device.Idiom == TargetIdiom.Phone && Device.OS == TargetPlatform.Windows)
            {
                grid_layout.WidthRequest  = App.ScreenWidth;
                grid_layout.HeightRequest = App.ScreenHeight;
            }
            if (Device.Idiom == TargetIdiom.Tablet && Device.OS == TargetPlatform.iOS)
            {
                grid_layout.RowDefinitions = new RowDefinitionCollection()
                {
                    new RowDefinition {
                        Height = App.ScreenHeight * 0.05
                    },
                    new RowDefinition {
                        Height = App.ScreenHeight * 0.95
                    },
                };
            }
            if (Device.Idiom == TargetIdiom.Tablet && Device.OS == TargetPlatform.Android)
            {
                Schedule.ViewHeaderHeight = 35;

                grid_layout.RowDefinitions = new RowDefinitionCollection()
                {
                    new RowDefinition {
                        Height = App.ScreenHeight * 0.05
                    },
                    new RowDefinition {
                        Height = App.ScreenHeight * 0.95
                    },
                };
            }


            HookEvents();
            scheduleview_list.ItemsSource  = Enum.GetValues(typeof(ScheduleView));
            scheduleview_list.SelectedItem = 0;
            DayViewSettings dayViewSettings = new DayViewSettings();

            dayViewSettings.WorkStartHour = 7;
            dayViewSettings.WorkEndHour   = 18;
            Schedule.DayViewSettings      = dayViewSettings;
            if (Device.OS != TargetPlatform.Windows && Device.OS != TargetPlatform.WinPhone)
            {
                Editor_Button.Image       = "editor.png";
                scheduleView_Button.Image = "scheduleview.png";
            }
            else
            {
                Editor_Button.Image       = (FileImageSource)ImageSource.FromFile("editor.png");
                scheduleView_Button.Image = (FileImageSource)ImageSource.FromFile("scheduleview.png");
            }

            Month_Button.Text = DateTime.Today.Date.ToString("MMMM, yyyy");
            if (Device.OS != TargetPlatform.Windows && Device.OS != TargetPlatform.WinPhone)
            {
                Schedule.HeaderHeight = 0;
            }
            else
            {
                if (App.Platform == Platforms.UWP)
                {
                    Schedule.HeaderHeight = 0;
                }
            }

            editor.AppointmentModified += Editor_AppointmentModified;;

            if (App.Platform == Platforms.WindowsPhone81)
            {
                grid_layout.HeightRequest = App.ScreenHeight;
                grid_layout.WidthRequest  = App.ScreenWidth;
            }

            if (Device.Idiom == TargetIdiom.Phone && Device.OS == TargetPlatform.Windows)
            {
                editor.IsVisible = false;
            }

            if (App.Platform == Platforms.Windows81 || App.Platform == Platforms.WindowsPhone81)
            {
                header_layout.IsVisible = false;
            }
        }
Esempio n. 13
0
        public Customization()
        {
            InitializeComponent();

            scheduleAppointment           = new ScheduleAppointment();
            scheduleAppointment.Subject   = "Family";
            scheduleAppointment.StartTime = DateTime.Now.Date.AddHours(10);
            scheduleAppointment.EndTime   = DateTime.Now.Date.AddHours(12);
            scheduleAppointment.Color     = (Color.FromHex("#FFD80073"));

            scheduleAppointment1           = new ScheduleAppointment();
            scheduleAppointment1.Subject   = "CheckUp";
            scheduleAppointment1.StartTime = DateTime.Now.Date.AddDays(1).AddHours(9);
            scheduleAppointment1.EndTime   = DateTime.Now.Date.AddDays(1).AddHours(11);
            scheduleAppointment1.Color     = Color.FromHex("#FFA2C139");

            scheduleAppointmentCollection = new ScheduleAppointmentCollection();
            scheduleAppointmentCollection.Add(scheduleAppointment);
            scheduleAppointmentCollection.Add(scheduleAppointment1);
            Schedule.DataSource = scheduleAppointmentCollection;


            if (Device.OS != TargetPlatform.Windows && Device.OS != TargetPlatform.WinPhone)
            {
                Schedule.HeaderHeight     = 0;
                Schedule.ViewHeaderHeight = 0;

                //On AppointmentLoaded
                Schedule.OnAppointmentLoadedEvent += Schedule_OnAppointmentLoadedEvent;
                //On MonthCellLoaded
                Schedule.OnMonthCellLoadedEvent += Schedule_OnMonthCellLoadedEvent;
            }
            else
            {
                if (App.Platform == Platforms.UWP && Device.Idiom == TargetIdiom.Desktop)
                {
                    Schedule.HeaderHeight = 0;
                }
            }

            //ViewHeaderStyle viewheaderstyle = new ViewHeaderStyle();
            //viewheaderstyle.BackgroundColor = Color.Black;

            //Schedule.HeaderStyle.TextColor = Color.Yellow;
            //Schedule.HeaderStyle.BackgroundColor = Color.Black;
            //Schedule.ViewHeaderStyle.DayTextColor = Color.Yellow;
            //Schedule.ViewHeaderStyle.BackgroundColor = Color.Black;


            if (Device.Idiom == TargetIdiom.Phone && Device.OS == TargetPlatform.Windows)
            {
                grid_layout.WidthRequest  = App.ScreenWidth;
                grid_layout.HeightRequest = App.ScreenHeight;
            }
            if (App.Platform == Platforms.Windows81 || App.Platform == Platforms.WindowsPhone81)
            {
                header_layout.IsVisible = false;
            }
            if (Device.Idiom == TargetIdiom.Tablet && Device.OS == TargetPlatform.iOS)
            {
                grid_layout.RowDefinitions = new RowDefinitionCollection()
                {
                    new RowDefinition {
                        Height = App.ScreenHeight * 0.05
                    },
                    new RowDefinition {
                        Height = App.ScreenHeight * 0.95
                    },
                };
            }
            Schedule.VisibleDatesChangedEvent += Schedule_VisibleDatesChangedEvent;
            Schedule.OnMonthCellLoadedEvent   += Schedule_OnMonthCellLoadedEvent;

            month_label.Text = DateTime.Today.Date.ToString("dd, MMMM, yyyy");

            CreateScheduleViewLayout();
            DayViewSettings dayViewSettings = new DayViewSettings();

            dayViewSettings.WorkStartHour = 7;
            dayViewSettings.WorkEndHour   = 18;
            Schedule.DayViewSettings      = dayViewSettings;
        }