Exemplo n.º 1
0
        protected override async Task OnInitializedAsync()
        {
            Tasks = (await TaskDataService.GetAll()).ToList();
            lock (Lock)
            {
                InitializeTimer();
                time.Start();
            }

            //<summary> apply list of logged in identity instead of all stored tasks / get identity running first
            //var users = await CalenderDataService.GetAll();
            //var currentuser = users.Where(a => a.User.Email == StaticResources.CurrentIdentityUser.identityUser.Email).FirstOrDefault();
            //Tasks = currentuser.Tasks;
            //<summary>
        }
Exemplo n.º 2
0
        private async void Timerexecutioncode(object sender, ElapsedEventArgs e)
        {
            var items = (await TaskDataService.GetAll()).ToList().Where(a => a.User == StaticResources.CurrentIdentityUser.appuser).ToList();

            var itemsabovecurrenttime = items.Where(a => a.StartDate > DateTime.Now);

            if (items.Where(a => a.StartDate > DateTime.Now).Any())
            {
                if (items.Where(a => a.StartDate < DateTime.Now.AddSeconds(1)).Any())
                {
                    ShowMessageStart();
                }
            }

            //var endingitemsabovecurrenttime = items.Where(a => a.EndDate > DateTime.Now);
            //if (items.Where(a => a.EndDate > DateTime.Now).Any())
            //{
            //    if (items.Where(a => a.EndDate < DateTime.Now.AddSeconds(1)).Any())
            //    {
            //        ShowMessageEnd();
            //    }
            //}
        }