示例#1
0
        private void CalendarClicked(object sender, EventArgs e)
        {
            if (currentEvent != null)
            {
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();


                if (currentEvent.startTime == DateTime.MinValue)
                {
                    saveAppointmentTask.StartTime = currentEvent.startTime;
                    saveAppointmentTask.EndTime   = currentEvent.startTime.AddHours(2);
                }
                else
                {
                    saveAppointmentTask.StartTime = DateTime.Now.AddHours(2);
                    saveAppointmentTask.EndTime   = DateTime.Now.AddHours(3);
                }
                saveAppointmentTask.Subject           = currentEvent.title;
                saveAppointmentTask.Location          = currentEvent.cityName;
                saveAppointmentTask.Details           = currentEvent.venueName;
                saveAppointmentTask.IsAllDayEvent     = false;
                saveAppointmentTask.Reminder          = Reminder.FifteenMinutes;
                saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

                saveAppointmentTask.Show();
            }
        }
        private void MenuSaveToCalendar_Click(object sender, RoutedEventArgs e)
        {
            var menuItem = sender as MenuItem;

            if (menuItem != null)
            {
                var selected = menuItem.DataContext as MovieInfo;
                if (null != selected)
                {
                    var saveAppointmentTask = new SaveAppointmentTask
                    {
                        StartTime = selected.StartTime,
                        //EndTime = null,
                        Subject           = selected.Title,
                        Location          = string.Format("{0} - {1}", selected.FilmCenterName, selected.Hall),
                        Details           = string.Format("票价:{0} 语言:{1}", selected.Price, selected.Language),
                        IsAllDayEvent     = false,
                        Reminder          = Reminder.FifteenMinutes,
                        AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.OutOfOffice
                    };

                    saveAppointmentTask.Show();
                }
            }
        }
        private void CreateEventParking()
        {
            DateTime timeParkingEnd = (DateTime)HourEvent;
            DateTime dateParkingEnd = (DateTime)DateEvent;
            DateTime endParking     = dateParkingEnd.Date + timeParkingEnd.TimeOfDay;

            // Make sure that the begin time has not already passed.
            if (endParking <= DateTime.Now)
            {
                MessageBox.Show("La date doit être dans le futur.");
            }
            else if (!IsolatedStorageSettings.ApplicationSettings.Contains("car"))
            {
                MessageBox.Show("Aucune position de voiture sauvegardée");
            }
            else
            {
                Car car = (Car)IsolatedStorageSettings.ApplicationSettings["car"];
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                saveAppointmentTask.StartTime         = DateTime.Now;
                saveAppointmentTask.EndTime           = endParking;
                saveAppointmentTask.Subject           = "Fin parking voiture";
                saveAppointmentTask.Location          = car.Address;
                saveAppointmentTask.Details           = "";
                saveAppointmentTask.IsAllDayEvent     = false;
                saveAppointmentTask.Reminder          = Reminder.FifteenMinutes;
                saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

                saveAppointmentTask.Show();
            }
        }
        private void CreateAppointment(int startDate, int finishDate, string groupName, string address)
        {
            DateTime            dateTime             = Extensions.UnixTimeStampToDateTime((double)startDate, true);
            SaveAppointmentTask saveAppointmentTask1 = new SaveAppointmentTask();
            DateTime?           nullable             = new DateTime?(dateTime);

            saveAppointmentTask1.StartTime = nullable;
            string str = groupName;

            saveAppointmentTask1.Subject = str;
            int num = 0;

            saveAppointmentTask1.IsAllDayEvent = (num != 0);
            SaveAppointmentTask saveAppointmentTask2 = saveAppointmentTask1;

            if (!string.IsNullOrEmpty(address))
            {
                saveAppointmentTask2.Location = address;
            }
            if (finishDate > startDate)
            {
                saveAppointmentTask2.EndTime = (new DateTime?(Extensions.UnixTimeStampToDateTime((double)finishDate, true)));
            }
            saveAppointmentTask2.Show();
        }
        private void Reminder_Click(object sender, EventArgs e)
        {
            SaveAppointmentTask SATask = new SaveAppointmentTask();
            SATask.Subject = "TV Show" + SearchResults.listingData.selectedItem.showName;
            SATask.Location = "ON TV";
            SATask.Details = SearchResults.listingData.selectedItem.episodeTitle;
            //prompt user for reminder?
            SATask.Reminder = Reminder.OneHour;

            SATask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;
            //get the date/time of the show and set as starttime
            DateTime dt1 = DateTime.Parse(SearchResults.listingData.selectedItem.listDate, CultureInfo.InvariantCulture);
            var date = new DateTime(dt1.Year, dt1.Month, dt1.Day, 0, 0, 0);
            string[] split = SearchResults.listingData.selectedItem.listTime.Split(new Char[] { ':', ' ' });
            var time = 0;
            if (split[2] == "PM")
            {
                time = int.Parse(split[0]) + 12;
            }
            else time = int.Parse(split[0]);

            var showTime = date.AddHours(time);
            showTime = showTime.AddMinutes(int.Parse(split[1]));
            SATask.StartTime = showTime;
            //get the duration of the show to add to start time
            int t1 = int.Parse(SearchResults.listingData.selectedItem.duration);
            SATask.EndTime = showTime.AddMinutes(t1);
            SATask.Show();

        }
        private void Schedule_Click(object sender, EventArgs e)
        {
            SaveAppointmentTask NewAppt = new SaveAppointmentTask();
            string DetailsText          = string.Format(
                "{0}.{1}.{2}.{3}\r\n{4}\r\n{5}\r\nReleased on {6}",
                MajorInput.Text, MinorInput.Text, BuildInput.Text, RevisionInput.Text,
                FriendlyNameShortDisplay.Text, FriendlyNameLongDisplay.Text,
                ReleaseDateDisplay.Text
                );

            // loop through all of the links and add those to
            // our buffer string
            //
            foreach (UIElement Child in LinkVersionContent.Children)
            {
                if (Child is HyperlinkButton)
                {
                    DetailsText += string.Format("\r\n{0}", ((HyperlinkButton)Child).Content);
                }
            }

            //NewAppt.StartTime = DateTime.Now.AddDays(1);
            NewAppt.StartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, 0, 0).AddDays(1);
            NewAppt.EndTime   = NewAppt.StartTime.Value.AddHours(1);

            NewAppt.Subject = string.Format("Apply {0}", FriendlyNameShortDisplay.Text);
            NewAppt.Details = DetailsText;

            NewAppt.Reminder          = Microsoft.Phone.Tasks.Reminder.FifteenMinutes;
            NewAppt.AppointmentStatus = AppointmentStatus.Busy;

            NewAppt.Show();
        }
        /// <summary>
        /// Shows the calendar application with a new appointment displayed, using the <see cref="SaveAppointmentServiceParams"/> instance.
        /// </summary>
        /// <param name="saveAppointmentServiceParams">The <see cref="SaveAppointmentServiceParams"/> instance.</param>
        public void Show(SaveAppointmentServiceParams saveAppointmentServiceParams)
        {
            #if WP8
            var saveAppointmentTask = new SaveAppointmentTask()
            {
                Subject = saveAppointmentServiceParams.Subject,
                Details = saveAppointmentServiceParams.Details,
                StartTime = saveAppointmentServiceParams.StartTime,
                EndTime = saveAppointmentServiceParams.EndTime,
            };

            if (saveAppointmentServiceParams.AppointmentStatus.HasValue)
            {
                saveAppointmentTask.AppointmentStatus = saveAppointmentServiceParams.AppointmentStatus.Value;
            }

            if (saveAppointmentServiceParams.IsAllDayEvent.HasValue)
            {
                saveAppointmentTask.IsAllDayEvent = saveAppointmentServiceParams.IsAllDayEvent.Value;
            }

            saveAppointmentTask.Show();
            #else
            throw new NotSupportedException("This service is not supported in Windows Phone 7.x");
            #endif
        }
示例#8
0
        /// <summary>
        /// Shows the calendar application with a new appointment displayed, using the <see cref="SaveAppointmentServiceParams"/> instance.
        /// </summary>
        /// <param name="saveAppointmentServiceParams">The <see cref="SaveAppointmentServiceParams"/> instance.</param>
        public void Show(SaveAppointmentServiceParams saveAppointmentServiceParams)
        {
#if WP8
            var saveAppointmentTask = new SaveAppointmentTask()
            {
                Subject   = saveAppointmentServiceParams.Subject,
                Details   = saveAppointmentServiceParams.Details,
                StartTime = saveAppointmentServiceParams.StartTime,
                EndTime   = saveAppointmentServiceParams.EndTime,
            };

            if (saveAppointmentServiceParams.AppointmentStatus.HasValue)
            {
                saveAppointmentTask.AppointmentStatus = saveAppointmentServiceParams.AppointmentStatus.Value;
            }

            if (saveAppointmentServiceParams.IsAllDayEvent.HasValue)
            {
                saveAppointmentTask.IsAllDayEvent = saveAppointmentServiceParams.IsAllDayEvent.Value;
            }

            saveAppointmentTask.Show();
#else
            throw new NotSupportedException("This service is not supported in Windows Phone 7.x");
#endif
        }
        private void btnSaveAppointmentTask_Click_1(object sender, RoutedEventArgs e)
        {
            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();
            saveAppointmentTask.StartTime = DateTime.Now.AddHours(1);
            saveAppointmentTask.EndTime = DateTime.Now.AddHours(2);
            saveAppointmentTask.Subject = "Artículo WP8";
            saveAppointmentTask.Details = "Escribir artículo Lanzadores en Windows Phone 8";
            saveAppointmentTask.Reminder = Reminder.FiveMinutes;

            saveAppointmentTask.Show();
        }
示例#10
0
        public void AddEvent(string Titulo, string Lugar, DateTime Inicio, DateTime Termina, string Descripcion)
        {
            SaveAppointmentTask appt = new SaveAppointmentTask();
            appt.Subject = Titulo;
            appt.Location = Lugar;
            appt.StartTime = Inicio;
            appt.EndTime = Termina;
            appt.Details = Descripcion;

            appt.Show();
        }
示例#11
0
        void appAppointmentBarIconBtn_Click(object sender, EventArgs e)
        {
            Day day = CalendarSelector.SelectedItems[0] as Day;

            if (day != null)
            {
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();
                saveAppointmentTask.StartTime = day.DateTime;
                saveAppointmentTask.EndTime   = day.DateTime.AddHours(1);
                saveAppointmentTask.Show();
            }
        }
示例#12
0
        public void AddEvent(string Titulo, string Lugar, DateTime Inicio, DateTime Termina, string Descripcion)
        {
            SaveAppointmentTask appt = new SaveAppointmentTask();

            appt.Subject   = Titulo;
            appt.Location  = Lugar;
            appt.StartTime = Inicio;
            appt.EndTime   = Termina;
            appt.Details   = Descripcion;

            appt.Show();
        }
        private void buttonSalvar_Click(object sender, RoutedEventArgs e)
        {
            string assunto = textBoxAssunto.Text;
            string local = textboxLocal.Text;
            DateTime? data = datepickerData.Value;
            DateTime? hora = timePickerHora.Value;
            HorarioLembrete lembrete = (HorarioLembrete) listLembrete.SelectedItem;
            string detalhes = textBoxDetalhes.Text;

            if(assunto == null || assunto.Trim().Equals(string.Empty))
            {
                MessageBox.Show("Assunto é obrigatório");
                return;
            }
            if (local == null || local.Trim().Equals(string.Empty))
            {
                MessageBox.Show("Local é obrigatório");
                return;
            }

            if (data == null)
            {
                MessageBox.Show("Data é obrigatório");
                return;
            }

            if (data == null)
            {
                MessageBox.Show("Horário é obrigatório");
                return;
            }

            if (lembrete == null)
            {
                MessageBox.Show("Lembrete é obrigatório");
                return;
            }

            DateTime dataHoraInicio = new DateTime(data.Value.Year, data.Value.Month, data.Value.Day, hora.Value.Hour, hora.Value.Minute, hora.Value.Second);
            

            SaveAppointmentTask compromisso = new SaveAppointmentTask()
            {
                Subject = assunto.Trim(),
                Location = local,
                StartTime = dataHoraInicio,
                Reminder = lembrete.Tempo,
                Details = detalhes
            };
            compromisso.Show();
            NavigationService.GoBack();
        }
示例#14
0
        private void save_appointment_task(object sender, RoutedEventArgs e)
        {
            SaveAppointmentTask save = new SaveAppointmentTask();

            save.Subject           = "Akşam yemeği";
            save.Location          = "Yan yol";
            save.Details           = "cüzdanını almayı unutma";
            save.StartTime         = new DateTime(2013, 6, 24);
            save.IsAllDayEvent     = true;
            save.Reminder          = Reminder.FifteenMinutes;
            save.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;
            save.Show();
        }
        private void AddAppointment_Click(object sender, EventArgs e)
        {
            var saveAppontmentTask = new SaveAppointmentTask();

            saveAppontmentTask.StartTime = DateTime.Now.AddHours(1);
            saveAppontmentTask.EndTime = DateTime.Now.AddHours(2);
            saveAppontmentTask.Subject = "Sample Appointment Demo entry";
            saveAppontmentTask.Location = "www.packtpub.com";
            saveAppontmentTask.Details = "Sample save appointment entry for Windows Phone";
            saveAppontmentTask.IsAllDayEvent = false;
            saveAppontmentTask.Reminder = Reminder.FifteenMinutes;
            saveAppontmentTask.AppointmentStatus = AppointmentStatus.Busy;

            saveAppontmentTask.Show();
        }
示例#16
0
        public void AddAppointment(DateTime startTime, DateTime endTime, String subject, String location, String details, Boolean isAllDay, AppointmentReminder reminder, AppointmentStatus status)
        {
            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime         = startTime;
            saveAppointmentTask.EndTime           = endTime;
            saveAppointmentTask.Subject           = subject;
            saveAppointmentTask.Location          = location;
            saveAppointmentTask.Details           = details;
            saveAppointmentTask.IsAllDayEvent     = isAllDay;
            saveAppointmentTask.Reminder          = ConvertReminder(reminder);
            saveAppointmentTask.AppointmentStatus = ConvertAppointmentStatus(status);

            saveAppointmentTask.Show();
        }
 private void appbar_add_calendar_Click(object sender, EventArgs e)
 {
     var vm = (SessionViewModel)this.LayoutRoot.DataContext;
     var session = vm.Session;
     var saveAppointmentTask = new SaveAppointmentTask();
     saveAppointmentTask.StartTime = session.Begins;
     saveAppointmentTask.EndTime = session.Ends;
     saveAppointmentTask.Subject = session.Title;
     saveAppointmentTask.Location = session.Location;
     saveAppointmentTask.Details = session.Abstract;
     saveAppointmentTask.IsAllDayEvent = false;
     saveAppointmentTask.Reminder = Microsoft.Phone.Tasks.Reminder.FifteenMinutes;
     saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;
     saveAppointmentTask.Show();
 }
        public void AddAppointment(DateTime startTime, DateTime endTime, String subject, String location, String details, Boolean isAllDay, AppointmentReminder reminder, AppointmentStatus status)
        {
            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime = startTime;
            saveAppointmentTask.EndTime = endTime;
            saveAppointmentTask.Subject = subject;
            saveAppointmentTask.Location = location;
            saveAppointmentTask.Details = details;
            saveAppointmentTask.IsAllDayEvent = isAllDay;
            saveAppointmentTask.Reminder = ConvertReminder(reminder);
            saveAppointmentTask.AppointmentStatus = ConvertAppointmentStatus(status);

            saveAppointmentTask.Show();
        }
        public  bool Remind(DateTime startDate, DateTime endtDate, string title, string message, int reminderVal)
        {

            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime = startDate;
            saveAppointmentTask.EndTime = endtDate;
            saveAppointmentTask.Subject = title;
            saveAppointmentTask.Details = message;
            saveAppointmentTask.IsAllDayEvent = false;
            saveAppointmentTask.Reminder = ConvertReminder(reminderVal);

            saveAppointmentTask.Show();

            return true;
        }
        public void AddAppointmentToCalendar(DateTime dateTimeOfAppt, long duration, string ApptTitle)
        {
            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime         = dateTimeOfAppt;
            saveAppointmentTask.EndTime           = dateTimeOfAppt.AddMinutes(30);
            saveAppointmentTask.Subject           = "Yapper Appointment: " + ApptTitle;
            saveAppointmentTask.Location          = "Yapper Appointment location: ";
            saveAppointmentTask.Details           = "Yapper Appointment details: ";
            saveAppointmentTask.IsAllDayEvent     = false;
            saveAppointmentTask.Reminder          = Reminder.FifteenMinutes;
            saveAppointmentTask.EndTime           = dateTimeOfAppt.AddTicks(duration);
            saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

            saveAppointmentTask.Show();
        }
示例#21
0
        public void ToUpper(string options)
        {
            PluginResult result;

            try
            {
                string[] args = JsonHelper.Deserialize<string[]>(options);
                string[] calendarValues = args[0].Split('|');

                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                string title = calendarValues[0];
                string location = calendarValues[1];
                string notes = calendarValues[2];

                int appointmentYear = int.Parse(calendarValues[3]);
                int appointmentMonth = int.Parse(calendarValues[4]);
                int appointmentDay = int.Parse(calendarValues[5]);
                int fromHour = int.Parse(calendarValues[6]);
                int fromMinute = int.Parse(calendarValues[7]);
                int durationMinutes = int.Parse(calendarValues[8]);

                var startDateTime = new DateTime(appointmentYear, appointmentMonth, appointmentDay, fromHour, fromMinute,
                    0);
                var endDateTime = startDateTime.AddMinutes(durationMinutes);

                saveAppointmentTask.StartTime = startDateTime;
                saveAppointmentTask.EndTime = endDateTime;
                saveAppointmentTask.Subject = title;
                saveAppointmentTask.Location = location;
                saveAppointmentTask.Details = notes;
                saveAppointmentTask.IsAllDayEvent = false;
                saveAppointmentTask.Reminder = Reminder.OneHour;
                saveAppointmentTask.AppointmentStatus = AppointmentStatus.Busy;

                saveAppointmentTask.Show();

                result = new PluginResult(PluginResult.Status.OK, "Calendar event added successfully.");
            }
            catch (Exception ex)
            {
                result = new PluginResult(PluginResult.Status.ERROR, ex.Message);
            }

            DispatchCommandResult(result);
        }
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            SaveAppointmentTask _save = new SaveAppointmentTask()
            {
                StartTime = ((DateTime)dteData.Value).AddHours(32),
                EndTime = ((DateTime)dteData.Value).AddHours(35),
                Subject = txtAssunto.Text,
                Location = txtLocal.Text,
                Details = txtDetalhe.Text,
                IsAllDayEvent = false,
                Reminder = ((Reminder)(Enum.GetValues(typeof(Reminder)).GetValue(lstLembrete.SelectedIndex))),
                AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy
            };
            _save.Show();

            if (NavigationService.CanGoBack) NavigationService.GoBack();
        }
示例#23
0
        void appts_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
        {
            EventsResult res      = e.State as EventsResult;
            double       hours    = double.Parse(res.duration);
            DateTime     original = DateTime.Parse(res.event_date);

            original = original.AddSeconds(-original.Second);
            string desc = System.Text.RegularExpressions.Regex.Replace(res.description, "(?<!\r)\n", "\r\n");

            if (e.Results.Count() != 0)
            {
                foreach (Appointment appointment in e.Results)
                {
                    if (appointment.StartTime == original &&
                        appointment.EndTime == original.Add(TimeSpan.FromHours(hours)) &&
                        appointment.Subject == res.name &&
                        appointment.Location == res.address &&
                        appointment.Details.Length == desc.Length)
                    {
                        MessageBox.Show(AppResources.AlreadyInTheCalendar, AppResources.InfoTitle, MessageBoxButton.OK);
                        return;
                    }
                }

                if (MessageBox.Show(AppResources.CalendarPrompt, AppResources.CalenderPromptTitle, MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
                {
                    return;
                }
            }

            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime         = original;
            saveAppointmentTask.EndTime           = original.Add(TimeSpan.FromHours(hours));
            saveAppointmentTask.Subject           = res.name;
            saveAppointmentTask.Location          = res.address;
            saveAppointmentTask.Details           = res.description;
            saveAppointmentTask.IsAllDayEvent     = false;
            saveAppointmentTask.Reminder          = Reminder.EighteenHours;
            saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

            saveAppointmentTask.Show();

            MainPage.data.CalendarData.result.Add(res);
            EmsApi.SaveToPhone(Newtonsoft.Json.JsonConvert.SerializeObject(MainPage.data.CalendarData), EventsData.calendarDataKey);
        }
示例#24
0
        public void addCalendarEntry(string options)
        {
            string[]            args           = JsonHelper.Deserialize <string[]>(options);
            long                timestampStart = Convert.ToInt64(args[3]);
            long                timestampEnd   = Convert.ToInt64(args[4]);
            DateTime            dtRef          = new DateTime(1970, 1, 1);
            SaveAppointmentTask saveTask       = new SaveAppointmentTask();

            saveTask.StartTime = new DateTime(dtRef.Ticks + 10000 * timestampStart).ToLocalTime();
            saveTask.EndTime   = new DateTime(dtRef.Ticks + 10000 * timestampEnd).ToLocalTime();
            saveTask.Location  = args[2];
            saveTask.Details   = args[1];
            saveTask.Subject   = args[0];

            saveTask.Show();

            this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK));
        }
示例#25
0
        private void add_calendar(object sender, EventArgs e)
        {
            MessageBoxResult m = MessageBox.Show("This will add the next occurence of this event to your calendar. Are you sure you want to continue?", "Calendar", MessageBoxButton.OKCancel);

            if (m == MessageBoxResult.OK)
            {
                List <RemindEvent> evenements = (List <RemindEvent>)IsolatedStorageSettings.ApplicationSettings["events"];
                TextBlock          id_block   = this.FindName("page_ID") as TextBlock;
                int pageIndex = int.Parse(id_block.Text);

                SaveAppointmentTask sat = new SaveAppointmentTask();
                sat.StartTime = evenements[pageIndex].lastTime.Add(evenements[pageIndex].repeatEvery);
                sat.Details   = "Created by RemindMe";
                sat.Subject   = evenements[pageIndex].label;
                //sat.EndTime = sat.StartTime + TimeSpan.FromHours(2);
                sat.Show();
            }
        }
示例#26
0
        private void add_calendar(object sender, EventArgs e)
        {
            MessageBoxResult m = MessageBox.Show("This will add the next occurence of this event to your calendar. Are you sure you want to continue?", "Calendar", MessageBoxButton.OKCancel);

            if (m == MessageBoxResult.OK)
            {
                List<RemindEvent> evenements = (List<RemindEvent>)IsolatedStorageSettings.ApplicationSettings["events"];
                TextBlock id_block = this.FindName("page_ID") as TextBlock;
                int pageIndex = int.Parse(id_block.Text);

                SaveAppointmentTask sat = new SaveAppointmentTask();
                sat.StartTime = evenements[pageIndex].lastTime.Add(evenements[pageIndex].repeatEvery);
                sat.Details = "Created by RemindMe";
                sat.Subject = evenements[pageIndex].label;
                //sat.EndTime = sat.StartTime + TimeSpan.FromHours(2);
                sat.Show();
            }
        }
示例#27
0
        public void SaveAppointment(FeedItem feedItem)
        {
            if (feedItem == null)
            {
                throw new Exception("feed item is null");
            }

            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask
            {
                StartTime         = feedItem.Date,
                EndTime           = feedItem.Date,
                Subject           = feedItem.Title,
                IsAllDayEvent     = false,
                Reminder          = Reminder.OneHour,
                AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy
            };

            saveAppointmentTask.Show();
        }
示例#28
0
        private void sheduleWorkout_Click(object sender, RoutedEventArgs e)
        {
            //define a task element
            SaveAppointmentTask workoutSchedule = new SaveAppointmentTask();

            //populate appointment's fields
            workoutSchedule.StartTime = startTimePicker.Value;

            workoutSchedule.EndTime = endTimePicker.Value;

            selectedWorkout = (Workout)listWorkouts.SelectedItem;

            workoutSchedule.Subject = selectedWorkout.Name.ToString();

            workoutSchedule.Location = locationBox.Text;

            workoutSchedule.Details = detailsBox.Text;

            //call the built-in calendar to proceed saving the appointment
            workoutSchedule.Show();
        }
示例#29
0
        private void btnAddCalendar_Click(object sender, RoutedEventArgs e)
        {
            Button calendarButton = (Button)sender;

            if (calendarButton.DataContext is Journey)
            {
                Journey             calendarJourney     = (Journey)calendarButton.DataContext;
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                saveAppointmentTask.StartTime         = calendarJourney.Legs[0].DepartureTime;
                saveAppointmentTask.EndTime           = calendarJourney.Legs[calendarJourney.Legs.Count - 1].ArrivalTime;
                saveAppointmentTask.Subject           = calendarJourney.Legs[0].Departure + " naar " + calendarJourney.Legs[calendarJourney.Legs.Count - 1].Arrival;
                saveAppointmentTask.Location          = calendarJourney.Legs[0].Departure;
                saveAppointmentTask.Details           = "Reisadvies hier";
                saveAppointmentTask.IsAllDayEvent     = false;
                saveAppointmentTask.Reminder          = Reminder.FifteenMinutes;
                saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

                saveAppointmentTask.Show();
            }
        }
        public void AddEvent(string options)
        {
            PluginResult result;

            try
            {
                string[] args           = JsonHelper.Deserialize <string[]>(options);
                string[] calendarValues = args[0].Split('|');

                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                int   appointmentYear  = int.Parse(calendarValues[3]);
                int   appointmentMonth = int.Parse(calendarValues[4]);
                int   appointmentDate  = int.Parse(calendarValues[5]);
                float appointmentTime  = float.Parse(calendarValues[6]);

                DateTime scheduleApptDateStart = (new DateTime(appointmentYear, appointmentMonth, appointmentDate, 7, 0, 0)).AddHours(appointmentTime);
                DateTime scheduleApptDateEnd   = (new DateTime(appointmentYear, appointmentMonth, appointmentDate, 7, 30, 0)).AddHours(appointmentTime);

                saveAppointmentTask.StartTime         = scheduleApptDateStart;
                saveAppointmentTask.EndTime           = scheduleApptDateEnd;
                saveAppointmentTask.Subject           = calendarValues[1];
                saveAppointmentTask.Location          = calendarValues[2];
                saveAppointmentTask.Details           = calendarValues[0];
                saveAppointmentTask.IsAllDayEvent     = false;
                saveAppointmentTask.Reminder          = Reminder.OneHour;
                saveAppointmentTask.AppointmentStatus = AppointmentStatus.Busy;

                saveAppointmentTask.Show();

                result = new PluginResult(PluginResult.Status.OK, "Calendar event added successfully.");
            }
            catch (Exception ex)
            {
                result = new PluginResult(PluginResult.Status.ERROR, ex.Message);
            }

            DispatchCommandResult(result);
        }
示例#31
0
        public void AddEvent(string options)
        {
            PluginResult result;

            try
            {
                string[] args = JsonHelper.Deserialize<string[]>(options);
                string[] calendarValues = args[0].Split('|');

                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                int appointmentYear = int.Parse(calendarValues[3]);
                int appointmentMonth = int.Parse(calendarValues[4]);
                int appointmentDate = int.Parse(calendarValues[5]);
                float appointmentTime = float.Parse(calendarValues[6]);

                DateTime scheduleApptDateStart = (new DateTime(appointmentYear, appointmentMonth, appointmentDate, 7, 0, 0)).AddHours(appointmentTime);
                DateTime scheduleApptDateEnd = (new DateTime(appointmentYear, appointmentMonth, appointmentDate, 7, 30, 0)).AddHours(appointmentTime);

                saveAppointmentTask.StartTime = scheduleApptDateStart;
                saveAppointmentTask.EndTime = scheduleApptDateEnd;
                saveAppointmentTask.Subject = calendarValues[1];
                saveAppointmentTask.Location = calendarValues[2];
                saveAppointmentTask.Details = calendarValues[0];
                saveAppointmentTask.IsAllDayEvent = false;
                saveAppointmentTask.Reminder = Reminder.OneHour;
                saveAppointmentTask.AppointmentStatus = AppointmentStatus.Busy;

                saveAppointmentTask.Show();

                result = new PluginResult(PluginResult.Status.OK, "Calendar event added successfully.");
            }
            catch (Exception ex)
            {
                result = new PluginResult(PluginResult.Status.ERROR, ex.Message);
            }

            DispatchCommandResult(result);
        }
示例#32
0
        public BirthdayItem(UserData profileData)
            : base(ProfileInfoItemType.RichText)
        {
            BirthdayItem birthdayItem = this;

            this.Title = CommonResources.ProfilePage_Info_BirthDate;
            string[] strArray = profileData.user.bdate.Split('.');
            if (strArray.Length < 2)
            {
                return;
            }
            int num1  = int.Parse(strArray[0]);
            int month = int.Parse(strArray[1]);
            int num2  = 0;

            if (strArray.Length > 2)
            {
                num2 = int.Parse(strArray[2]);
            }
            string str1 = string.Format("{0} {1}", num1, BirthdayItem.GetOfMonthStr(month));

            if (num2 != 0)
            {
                str1 = str1 + " " + num2;
            }
            this.Data             = str1;
            this.NavigationAction = (Action)(() =>
            {
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();
                DateTime?nullable = new DateTime?(birthdayItem.GetBirthday(profileData.user));
                saveAppointmentTask.StartTime = nullable;
                string str2 = string.Format("{0}: {1}", CommonResources.ProfilePage_Info_Birthday, profileData.user.Name);
                saveAppointmentTask.Subject = str2;
                int num3 = 0;
                saveAppointmentTask.IsAllDayEvent = (num3 != 0);
                saveAppointmentTask.Show();
            });
        }
        private void MenuSaveToCalendar_Click(object sender, RoutedEventArgs e)
        {
            var menuItem = sender as MenuItem;
            if (menuItem != null)
            {
                var selected = menuItem.DataContext as MovieInfo;
                if (null != selected)
                {
                    var saveAppointmentTask = new SaveAppointmentTask
                    {
                        StartTime = selected.StartTime,
                        //EndTime = null,
                        Subject = selected.Title,
                        Location = string.Format("{0} - {1}", selected.FilmCenterName, selected.Hall),
                        Details = string.Format("票价:{0} 语言:{1}", selected.Price, selected.Language),
                        IsAllDayEvent = false,
                        Reminder = Reminder.FifteenMinutes,
                        AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.OutOfOffice
                    };

                    saveAppointmentTask.Show();
                }
            }
        }
        private void AddReminder()
        {
            try
            {
                if (SelectedSearch != null &&
                    ReisMogelijkheden != null &&
                    SelectedReisMogelijkheid != null)
                {
                    //int index = ReisMogelijkheden.IndexOf(SelectedReisMogelijkheid);
                    //NavigationService.NavigateTo(new Uri(string.Format("/Views/Reminder.xaml?id={0}&index={1}&time={2}&spoor={3}", SelectedSearch.Id, index, SelectedReisMogelijkheid.GeplandeVertrekTijd, SelectedReisMogelijkheid.ReisDelen.First().ReisStops.First().Vertrekspoor), UriKind.Relative));

                    SaveAppointmentTask saveAp = new SaveAppointmentTask();
                    saveAp.StartTime     = SelectedReisMogelijkheid.GeplandeVertrekTijd;
                    saveAp.EndTime       = SelectedReisMogelijkheid.GeplandeAankomstTijd;
                    saveAp.Subject       = SelectedSearch.DisplayFull;
                    saveAp.Details       = SelectedReisMogelijkheid.GetAsText();
                    saveAp.Location      = SelectedSearch.VanStation.Name;
                    saveAp.IsAllDayEvent = false;

                    saveAp.Show();
                }
            }
            catch { }
        }
        private void AddReminder()
        {
            if (CurrentBand == null) return;

            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();
            saveAppointmentTask.StartTime = CurrentBand.Starts;
            saveAppointmentTask.EndTime = CurrentBand.Ends;
            saveAppointmentTask.Subject = CurrentBand.Name;
            saveAppointmentTask.Location = _groezrockService.GetStageFromBand(CurrentBand.Name)+ ", Groezrock";
            saveAppointmentTask.IsAllDayEvent = false;
            saveAppointmentTask.Reminder = Reminder.FifteenMinutes;
            saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;
            saveAppointmentTask.Show();

            AppointmentNotAdded = false;
        }
示例#36
0
        private void tuppee()
        {

            try
            {
                /*Reminder remind1 = new Reminder("One");
                //Uri navigationUri = new Uri("/Reminder1.xaml", UriKind.Relative);
                remind1.Title = "Please take your Medicine now";
                remind1.Content = "Click to see which tablets";
                remind1.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                //remind1.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                //remind1.RecurrenceType = 0;
                //remind1.NavigationUri = navigationUri;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind1);

                Reminder remind2 = new Reminder("Two");
                //Uri navigationUri = new Uri("/Reminder1.xaml", UriKind.Relative);
                remind2.Title = "Please take your Medicine now";
                remind2.Content = "Click to see which tablets";
                remind2.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                //remind1.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                //remind1.RecurrenceType = 0;
                //remind1.NavigationUri = navigationUri;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind2);

                Reminder remind3 = new Reminder("Three");
                //Uri navigationUri = new Uri("/Reminder1.xaml", UriKind.Relative);
                remind3.Title = "Please take your Medicine now";
                remind3.Content = "Click to see which tablets";
                remind3.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                //remind1.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                //remind1.RecurrenceType = 0;
                //remind1.NavigationUri = navigationUri;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind3);
                /*
                Reminder remind2 = new Reminder("Time for your medicine");
                Uri navigationUri2 = new Uri("/Reminder2.xaml", UriKind.Relative);
                remind2.Title = "Please take your Medicine now";
                remind2.Content = "Click to see which tablets";
                remind2.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                remind2.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                remind2.RecurrenceType = 0;
                remind2.NavigationUri = navigationUri2;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind2);


                Reminder remind3 = new Reminder("Time for your medicine");
                Uri navigationUri3 = new Uri("/Reminder3.xaml", UriKind.Relative);
                remind3.Title = "Time for your Doctors Appointment";
                remind3.Content = "Click to see which tablets";
                remind3.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                remind3.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                remind3.RecurrenceType = 0;
                remind3.NavigationUri = navigationUri3;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind3);*/
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                saveAppointmentTask.StartTime = DateTime.Now.AddHours(0);
                saveAppointmentTask.EndTime = DateTime.Now.AddHours(1);
                saveAppointmentTask.Subject = "Doctors Name";
                saveAppointmentTask.Location = "Doctors Location";
                saveAppointmentTask.Details = "Appointment details";
                saveAppointmentTask.IsAllDayEvent = false;
                saveAppointmentTask.Reminder = Reminder.FiveMinutes;
                saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

                saveAppointmentTask.Show();


            }
            catch (Exception e)
            {
                System.Diagnostics.Debugger.Log(1, "Gen", "Hen");
            }

            R1.StrokeThickness /= 2;
            R2.StrokeThickness /= 2;
            R3.StrokeThickness /= 2;
            R4.StrokeThickness /= 2;
            R5.StrokeThickness /= 2;
            R6.StrokeThickness /= 2;
            R7.StrokeThickness /= 2;
            R8.StrokeThickness /= 2;
            R9.StrokeThickness /= 2;
            R10.StrokeThickness /= 2;
            R11.StrokeThickness /= 2;
            R12.StrokeThickness /= 2;
            R13.StrokeThickness /= 2;
            R14.StrokeThickness /= 2;
            R15.StrokeThickness /= 2;
            R16.StrokeThickness /= 2;
            R17.StrokeThickness /= 2;
            R18.StrokeThickness /= 2;
            R19.StrokeThickness /= 2;
            R20.StrokeThickness /= 2;
            R21.StrokeThickness /= 2;
            R22.StrokeThickness /= 2;
            R23.StrokeThickness /= 2;
            R24.StrokeThickness /= 2;
            R25.StrokeThickness /= 2;
            R26.StrokeThickness /= 2;
            R27.StrokeThickness /= 2;
            R28.StrokeThickness /= 2;
            R29.StrokeThickness /= 2;
            R30.StrokeThickness /= 2;
            R31.StrokeThickness /= 2;
            R32.StrokeThickness /= 2;
            R33.StrokeThickness /= 2;
            R34.StrokeThickness /= 2;
            R35.StrokeThickness /= 2;
        }
        void appts_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
        {
            EventsResult res = e.State as EventsResult;
            double hours = double.Parse(res.duration);
            DateTime original = DateTime.Parse(res.event_date);
            original = original.AddSeconds(-original.Second);
            string desc = System.Text.RegularExpressions.Regex.Replace(res.description, "(?<!\r)\n", "\r\n");

            if (e.Results.Count() != 0)
            {
                foreach (Appointment appointment in e.Results)
                {
                    if (appointment.StartTime == original
                        && appointment.EndTime == original.Add(TimeSpan.FromHours(hours))
                        && appointment.Subject == res.name
                        && appointment.Location == res.address
                        && appointment.Details.Length == desc.Length)
                    {
                        MessageBox.Show(AppResources.AlreadyInTheCalendar, AppResources.InfoTitle, MessageBoxButton.OK);
                        return;
                    }
                }

                if (MessageBox.Show(AppResources.CalendarPrompt, AppResources.CalenderPromptTitle, MessageBoxButton.OKCancel) == MessageBoxResult.Cancel)
                    return;
            }

            SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

            saveAppointmentTask.StartTime = original;
            saveAppointmentTask.EndTime = original.Add(TimeSpan.FromHours(hours));
            saveAppointmentTask.Subject = res.name;
            saveAppointmentTask.Location = res.address;
            saveAppointmentTask.Details = res.description;
            saveAppointmentTask.IsAllDayEvent = false;
            saveAppointmentTask.Reminder = Reminder.EighteenHours;
            saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

            saveAppointmentTask.Show();

            MainPage.data.CalendarData.result.Add(res);
            EmsApi.SaveToPhone(Newtonsoft.Json.JsonConvert.SerializeObject(MainPage.data.CalendarData), EventsData.calendarDataKey);
        }
示例#38
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {

            try
            {
                /*Reminder remind1 = new Reminder("One");
                //Uri navigationUri = new Uri("/Reminder1.xaml", UriKind.Relative);
                remind1.Title = "Please take your Medicine now";
                remind1.Content = "Click to see which tablets";
                remind1.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                //remind1.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                //remind1.RecurrenceType = 0;
                //remind1.NavigationUri = navigationUri;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind1);

                Reminder remind2 = new Reminder("Two");
                //Uri navigationUri = new Uri("/Reminder1.xaml", UriKind.Relative);
                remind2.Title = "Please take your Medicine now";
                remind2.Content = "Click to see which tablets";
                remind2.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                //remind1.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                //remind1.RecurrenceType = 0;
                //remind1.NavigationUri = navigationUri;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind2);

                Reminder remind3 = new Reminder("Three");
                //Uri navigationUri = new Uri("/Reminder1.xaml", UriKind.Relative);
                remind3.Title = "Please take your Medicine now";
                remind3.Content = "Click to see which tablets";
                remind3.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                //remind1.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                //remind1.RecurrenceType = 0;
                //remind1.NavigationUri = navigationUri;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind3);
                /*
                Reminder remind2 = new Reminder("Time for your medicine");
                Uri navigationUri2 = new Uri("/Reminder2.xaml", UriKind.Relative);
                remind2.Title = "Please take your Medicine now";
                remind2.Content = "Click to see which tablets";
                remind2.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                remind2.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                remind2.RecurrenceType = 0;
                remind2.NavigationUri = navigationUri2;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind2);


                Reminder remind3 = new Reminder("Time for your medicine");
                Uri navigationUri3 = new Uri("/Reminder3.xaml", UriKind.Relative);
                remind3.Title = "Time for your Doctors Appointment";
                remind3.Content = "Click to see which tablets";
                remind3.BeginTime = DateTime.Parse("26/01/2014 9:30:00");
                remind3.ExpirationTime = DateTime.Parse("26/01/2014 9:45:00");
                remind3.RecurrenceType = 0;
                remind3.NavigationUri = navigationUri3;

                // Register the reminder with the system.
                ScheduledActionService.Add(remind3);*/
                SaveAppointmentTask saveAppointmentTask = new SaveAppointmentTask();

                saveAppointmentTask.StartTime = DateTime.Now.AddHours(0);
                saveAppointmentTask.EndTime = DateTime.Now.AddHours(1);
                saveAppointmentTask.Subject = "Doctors Name";
                saveAppointmentTask.Location = "Name of Tablet";
                saveAppointmentTask.Details = "Appointment details";
                saveAppointmentTask.IsAllDayEvent = false;
                saveAppointmentTask.Reminder = Reminder.FiveMinutes;
                saveAppointmentTask.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

                saveAppointmentTask.Show();


            }
            catch (Exception ee)
            {
                System.Diagnostics.Debugger.Log(1, "Gen", "Hen");
            }
        }
        /// <summary>
        /// Creates a calendar entry for the event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ButtonReminder_Click(object sender, RoutedEventArgs e)
        {
            Button bttn = sender as Button;

            List<EventData> Event = await App.MobileService.GetTable<EventData>().Where(x => x.ID == Convert.ToInt32(bttn.Tag)).ToListAsync();
            EventData ed = new EventData();

            ed = Event.ElementAt(0);

            SaveAppointmentTask saveAppointment = new SaveAppointmentTask();

            saveAppointment.StartTime = ed.Date;
            saveAppointment.EndTime = ed.Date.AddMinutes(Convert.ToDouble(ed.Duration));
            saveAppointment.Subject = ed.Title;
            saveAppointment.Location = ed.Location;
            saveAppointment.Details = ed.Description;
            saveAppointment.Reminder = Reminder.OneHour;
            saveAppointment.AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy;

            saveAppointment.Show();
        }
示例#40
0
 private void AddToCalendar()
 {
     /* Add to calendar */
     DateTime dtStartTime = new DateTime(StartDate.Year, StartDate.Month, StartDate.Day, _event.StartTime.Hour, _event.StartTime.Minute, _event.StartTime.Second);
     DateTime dtEndTime = new DateTime(EndDate.Year, EndDate.Month, EndDate.Day, _event.EndTime.Hour, _event.EndTime.Minute, _event.EndTime.Second);
     var appt = new SaveAppointmentTask
     {
         AppointmentStatus = Microsoft.Phone.UserData.AppointmentStatus.Busy,
         Subject = Title,
         Details = EventTypeConverter(Type) + " " + CourseName,
         Location = Location,
         StartTime = dtStartTime,
         EndTime = dtEndTime,
         Reminder = Reminder.OneHour
     };
     appt.Show();
 }