void ScheduleToast(String updateString, DateTime dueTime, int idNumber)
        {
            // Scheduled toasts use the same toast templates as all other kinds of toasts.
            IToastText02 toastContent = ToastContentFactory.CreateToastText02();

            toastContent.TextHeading.Text  = updateString;
            toastContent.TextBodyWrap.Text = "Received: " + dueTime.ToLocalTime();

            ScheduledToastNotification toast;

            if (RepeatBox.IsChecked != null && (bool)RepeatBox.IsChecked)
            {
                toast = new ScheduledToastNotification(toastContent.GetXml(), dueTime, TimeSpan.FromSeconds(60), 5);

                // You can specify an ID so that you can manage toasts later.
                // Make sure the ID is 15 characters or less.
                toast.Id = "Repeat" + idNumber;
            }
            else
            {
                toast    = new ScheduledToastNotification(toastContent.GetXml(), dueTime);
                toast.Id = "Toast" + idNumber;
            }

            ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast);
            rootPage.NotifyUser("Scheduled a toast with ID: " + toast.Id, NotifyType.StatusMessage);
        }
Exemplo n.º 2
0
        public void SubmitNewTask()
        {
            String   head   = taskHeader;
            String   cont   = taskContent;
            DateTime output = taskDate;

            String valid = Validate(head, cont, output);

            if (valid.Equals("true"))
            {
                //UKRYJ TWORZENIE KARTECZKi
                isNewTaskVisible = Visibility.Collapsed;
                taskHeader       = "";
                taskContent      = "";
                //taskDate = "";

                //STWORZ DATE ZE STRINGA
                //DateTime output;
                //DateTime.TryParseExact(dat, "dd.MM.yyyy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out output);

                //UTWORZ KARTECZKE
                int  lastId = GetLastID();
                Note custom = new Note {
                    id = lastId, parentid = 0, header = head, content = cont, date = output
                };

                //ADD #1
                custom.header = custom.header + " #1";

                //UTWÓRZ NOW¥ LISTE
                var empty = new CollectionRepresentation {
                    NoteCollection = new ObservableCollection <Note>()
                };
                //DODAJ KARTECZKE DO LISTY
                empty.NoteCollection.Add(custom);
                //DODAJ LISTE DO GRIDVIEW
                NotesCollection.Add(empty);

                //WYSWIETL KOMUNIKAT SUKCESU
                IToastText02 notification = ToastContentFactory.CreateToastText02();
                notification.TextHeading.Text  = "Sukces";
                notification.TextBodyWrap.Text = "Utworzono now¹ karteczkê!";
                notification.Duration          = ToastDuration.Short;

                ToastNotification not = new ToastNotification(notification.GetXml());
                ToastNotificationManager.CreateToastNotifier().Show(not);
            }
            else
            {
                //WYSWIETL KOMUNIKAT BLEDU
                IToastText02 notification = ToastContentFactory.CreateToastText02();
                notification.TextHeading.Text  = "B³¹d";
                notification.TextBodyWrap.Text = valid;
                notification.Duration          = ToastDuration.Short;

                ToastNotification not = new ToastNotification(notification.GetXml());
                ToastNotificationManager.CreateToastNotifier().Show(not);
            }
        }
Exemplo n.º 3
0
        public void NotificateAboutUpcomingTask()
        {
            if (Notificate == true && NotesCollection.Count > 0)
            {
                DateTime early = new DateTime(9999, 12, 30);
                String   head  = "";
                DateTime today = DateTime.Now.Date;
                foreach (CollectionRepresentation collection in NotesCollection)
                {
                    foreach (Note n in collection.NoteCollection)
                    {
                        if (n.date.CompareTo(early) < 0)
                        {
                            early = n.date;
                            head  = n.header;
                        }
                    }
                }

                //DISPLAY MSG TODAY
                if (early.Date.CompareTo(today) < 0)
                {
                    IToastText02 notification = ToastContentFactory.CreateToastText02();
                    notification.TextHeading.Text  = "Min¹³ termin zadania!";
                    notification.TextBodyWrap.Text = head;
                    notification.Duration          = ToastDuration.Short;

                    ToastNotification not = new ToastNotification(notification.GetXml());
                    not.ExpirationTime = DateTimeOffset.Now.AddSeconds(5);
                    ToastNotificationManager.CreateToastNotifier().Show(not);
                }
                else if (early.Date.CompareTo(today) == 0)
                {
                    IToastText02 notification = ToastContentFactory.CreateToastText02();
                    notification.TextHeading.Text  = "Dzisiaj mija termin zadania!";
                    notification.TextBodyWrap.Text = head;
                    notification.Duration          = ToastDuration.Short;

                    ToastNotification not = new ToastNotification(notification.GetXml());
                    not.ExpirationTime = DateTimeOffset.Now.AddSeconds(5);
                    ToastNotificationManager.CreateToastNotifier().Show(not);
                }
                else
                {
                    IToastText02 notification = ToastContentFactory.CreateToastText02();
                    notification.TextHeading.Text  = "Zbli¿a siê termin zadania!";
                    notification.TextBodyWrap.Text = head + " (" + early.Date.ToString("dd.MM.yyyy") + ")";
                    notification.Duration          = ToastDuration.Short;

                    ToastNotification not = new ToastNotification(notification.GetXml());
                    not.ExpirationTime = DateTimeOffset.Now.AddSeconds(5);
                    ToastNotificationManager.CreateToastNotifier().Show(not);
                }
            }
        }
Exemplo n.º 4
0
        private void SaveToast(string updatedString, DateTime dueTime, int id)
        {
            IToastText02 toastContent = ToastContentFactory.CreateToastText02();

            toastContent.TextHeading.Text  = updatedString;
            toastContent.TextBodyWrap.Text = "Notificare de la World Of Quizz!";

            ScheduledToastNotification toast;

            toast = new ScheduledToastNotification(toastContent.GetXml(), dueTime);
            ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast);
        }
Exemplo n.º 5
0
        public static void ScheduleToast(string updateString, int eventID, DateTime dueTime, bool RepeatToast = false)
        {
            if (dueTime < DateTime.Now)
            {
                return;
            }
            //Random rand = new Random();
            //int idNumber = rand.Next(0, 10000000);
            // Scheduled toasts use the same toast templates as all other kinds of toasts.
            //ToastContent toastContent = To
            IToastText02 toastContent = ToastContentFactory.CreateToastText02();

            toastContent.TextHeading.Text = updateString;
            //toastContent.TextBodyWrap.Text = "Received: " + dueTime.ToLocalTime();

            ScheduledToastNotification toast;

            //Этот код нужен если отложить напоминайку
            if (RepeatToast == true)
            {
                toast = new ScheduledToastNotification(toastContent.GetXml(), dueTime, TimeSpan.FromSeconds(60), 5);

                // You can specify an ID so that you can manage toasts later.
                // Make sure the ID is 15 characters or less.
                //toast.Id = "Repeat" + eventID;
            }
            else
            {
                toast = new ScheduledToastNotification(toastContent.GetXml(), dueTime);
            }
            toast.Id = eventID.ToString();
            //Everyday.listNotrfications.Add(toast.Id);
            ToastNotifier notifier = ToastNotificationManager.CreateToastNotifier();

            notifier.AddToSchedule(toast);
            //NotifyUser("Event scheduled on " + dueTime + ", a toast with ID: " + toast.Id, NotifyType.StatusMessage);
        }
Exemplo n.º 6
0
        void ScheduleToast(String updateString, DateTime dueTime, int idNumber)
        {
            IToastText02 toastContent = ToastContentFactory.CreateToastText02();

            toastContent.TextHeading.Text  = updateString;
            toastContent.TextBodyWrap.Text = "Received: " + dueTime.ToLocalTime();

            ScheduledToastNotification toast;

            toast    = new ScheduledToastNotification(toastContent.GetXml(), dueTime);
            toast.Id = "Toast" + idNumber;

            ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast);

            noti.Text = "Toast ID: " + toast.Id;
        }
Exemplo n.º 7
0
        private async void reminder_button_Click(object sender, RoutedEventArgs e)
        {
            MessageDialog showDialog = new MessageDialog("wenst u een reminder een half uur voor de afspraak ?");

            showDialog.Commands.Add(new UICommand("Ok")
            {
                Id = 0
            });
            showDialog.Commands.Add(new UICommand("Cancel")
            {
                Id = 1
            });
            showDialog.DefaultCommandIndex = 1;
            var result = await showDialog.ShowAsync();

            if ((int)result.Id == 1)
            {
                Frame.Navigate(typeof(Newsfeed));
            }
            if ((int)result.Id == 0)
            {
                String[] datumFormat       = datum.Text.Split('/');
                String[] tijdformat        = tijd.Text.Split(':');
                DateTime datumNotification = new DateTime(Int32.Parse(datumFormat[2]), Int32.Parse(datumFormat[0]), Int32.Parse(datumFormat[1]), Int32.Parse(tijdformat[0]), Int32.Parse(tijdformat[1]), Int32.Parse(tijdformat[2]));
                datumNotification.AddMinutes(-30);
                IToastText02 toast = ToastContentFactory.CreateToastText02();
                toast.TextHeading.Text  = newsitem.Titel;;
                toast.TextBodyWrap.Text = newsitem.Inhoud;
                ScheduledToastNotification toastNotification = new ScheduledToastNotification(toast.GetXml(), datumNotification);
                toastNotification.Id = "id";
                ToastNotificationManager.CreateToastNotifier().AddToSchedule(toastNotification);
                Frame.Navigate(typeof(Newsfeed));
            }
        }