Esempio n. 1
0
    void sendRandomNotification()
    {
        int    index    = random.Next(0, messages.Length);
        String mensagem = messages[index];

        MyNotifications.CallNotification(mensagem, 3);
    }
Esempio n. 2
0
        //
        //
        //END PROJECT MANAGER SECTION
        //#########################################################################

        //#########################################################################
        //START NOTIFICATIONS SECTION
        // GET: BT/MyNotifications
        public ActionResult MyNotifications()
        {
            var currentUser   = db.Users.Find(User.Identity.GetUserId());
            var notifications = db.TicketNotifications.Where(n => n.UserID == currentUser.Id).OrderByDescending(n => n.Created).ToList();

            var unreadNotifications = notifications.Where(n => n.Read == false).ToList();
            var readNotifications   = notifications.Where(n => n.Read == true).ToList();

            var MyNotificationsList = new List <MyNotifications>();

            foreach (var item in notifications)
            {
                var MyNotifications = new MyNotifications();
                MyNotifications.Notification   = item;
                MyNotifications.NotificationId = item.Id;
                MyNotifications.MarkAsRead     = false;

                MyNotificationsList.Add(MyNotifications);
            }
            ViewData["MyNotifications"] = MyNotificationsList;
            ViewData["Read"]            = notifications;
            ViewData["currentUser"]     = currentUser;



            return(View(MyNotificationsList));
        }
Esempio n. 3
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag(GameManager.PLAYER_TAG))
     {
         CNHManager.points = CNHManager.REMOVE_ALL_POINTS;
         MyNotifications.CallNotification(MyNotifications.RUN_OVER_PEDESTRIAN_MESSAGE, 10);
     }
 }
Esempio n. 4
0
    IEnumerator moja()
    {
        yield return(new WaitForSeconds(1));

        MyNotifications.CallNotification("Hello World!", 3);
        MyNotifications.CallNotification("MyNotifications", 4);
        MyNotifications.CallNotification("Goodbye World!", 3);
    }
Esempio n. 5
0
 protected override void OnStart()
 {
     MyNotifications.GenerateNotifications(DateTime.Now.DayOfWeek.ToString(), GetTomorrow());
     MessagingCenter.Subscribe <string>(this, "CreateSystemNotifications", (e) =>
     {
         MyNotifications.GenerateNotifications(e, GetTomorrow());
     });
 }
Esempio n. 6
0
 public void FastenBelt()
 {
     if (!beltFastened)
     {
         beltFastened = true;
         MyNotifications.CallNotification(MyNotifications.SEAT_BELT_MESSAGE, 3);
         points += CNHManager.POINTS_WITH_SEAT_BELT;
         print("apertou cinto: " + CNHManager.points);
     }
 }
Esempio n. 7
0
    // Update is called once per frame
    void Update()
    {
        if (DateTime.Compare(changedHole.AddSeconds(SECONDS_CHANGE_HOLES), DateTime.Now) < 0)
        {
            changeHoles();
        }

        if (1 == random.Next(1, 2000))
        {
            sendRandomNotification();
        }

        if (alcoolQuantity > 0)
        {
            staticVisaoNormal = visaoDificultada;
            alcoolQuantity--;
            alcool = true;
        }
        else
        {
            staticVisaoNormal = visao;
            alcool            = false;
        }

        if (CNHManager.points <= 0)
        {
            MyNotifications.CallNotification(MyNotifications.LOST_ALL_POINTS_MESSAGE, 3);
            Invoke(MENU_METHOD, 3);
        }

        if (CNHManager.life <= 0)
        {
            MyNotifications.CallNotification(MyNotifications.LOST_ALL_LIFE_MESSAGE, 3);
            Invoke(MENU_METHOD, 3);
        }

        if (CarManager.fuel <= 0)
        {
            MyNotifications.CallNotification(MyNotifications.LOST_ALL_FUEL_MESSAGE, 3);
            Invoke(MENU_METHOD, 3);
        }

        if (CarManager.mechanic <= 0)
        {
            MyNotifications.CallNotification(MyNotifications.LOST_ALL_MECHANIC_MESSAGE, 3);
            Invoke(MENU_METHOD, 3);
        }

        CNHManager.life -= 1;
        imagem.sprite    = staticVisaoNormal;
    }
Esempio n. 8
0
        public override IEnumerable <MenuItem> GetDynamicMenuItems()
        {
            if (this.userSecurityContext.CanAccess(typeof(MyNotifications)))
            {
                //var notificationCount = this.context.Notifications
                //	.Count(t => t.ReadOn == null && t.ArchivedOn == null);

                var count = new Random().Next(1, 100);

                yield return(MyNotifications
                             .Button($"<i class='far fa-bell' title='Notifications'></i>{UiFormConstants.CounterForTopMenu(count)}")
                             .AsMenuItem(Notifications));
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Метод изменения переключателя уведомления
        /// </summary>
        /// <param name="sender">Отправитель Switch</param>
        /// <param name="e">Событие</param>
        async void EditNotify(object sender, ToggledEventArgs e)
        {
            Switch sw   = sender as Switch;
            Note   note = (Note)sw.BindingContext;

            if (note != null)
            {
                if (!note.IsNotify)
                {
                    NotificationCenter.Current.Cancel(note.ID);
                }
                await database.SaveNoteAsync(note);

                base.OnAppearing();
                MyNotifications.GenerateNotifications("Sunday");
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Действия при загрузке страницы
        /// </summary>
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            // Загрузка базы данных.
            var notes = await Sunday.Database.GetNotesAsync();

            // Подписываем метод на событие.
            var page = Navigation.NavigationStack[0] as NotesPage;

            EditNoteEvent += page.UpdateNowNotes;
            // Вызываем событие.
            EditNoteEvent?.Invoke();

            // Подготовка уведомлений.
            MyNotifications.GenerateNotifications("Sunday");

            // Сортировка заметок по времени и передеча в ListView.
            listView.ItemsSource = notes.OrderBy(x => x.NotificationTime)
                                   .OrderByDescending(x => x.IsNotify);
        }
Esempio n. 11
0
    IEnumerator mainStep()
    {
        yield return(new WaitUntil(() => bStart == true));

        while (bStart)
        {
            yield return(new WaitForSeconds(1));

            MyNotifications.CallNotification("Listen Background Music", 5);
            yield return(new WaitForSeconds(1));

            BgMusic.Play();
            yield return(new WaitForSeconds(5));


            MyNotifications.CallNotification("Listen Music Note", 20);
            string[] requirtNote = { "", "", "" };
            requirtNote = muiscNote[0].Split(',');
            PlayRequire(requirtNote);
            yield return(new WaitForSeconds(20));

            MyNotifications.CallNotification("Goodbye World!", 3);
        }
    }
Esempio n. 12
0
 protected override void OnSleep()
 {
     MyNotifications.GenerateNotifications(DateTime.Now.DayOfWeek.ToString(), GetTomorrow());
 }