Exemplo n.º 1
0
        protected override async void LoadItemsAsync()
        {
            if (!_favoritesStorage.Any())
            {
                Items = null;
                return;
            }

            IsBusy = true;

            IEnumerable <Trigger> triggers;

            try
            {
                triggers = await Executer.Execute(() => TriggerProxyServer.GetTriggers(null, null,
                                                                                       null, Select.Extend, _favoritesStorage.Favorites().Select(f => f.Id).ToList()));
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
                return;
            }
            finally
            {
                IsBusy = false;
            }

            Items = triggers.OrderBy(trigger => trigger.IsOk)
                    .ThenByDescending(trigger => trigger.Priority)
                    .ThenBy(trigger => trigger.Description)
                    .ToList();
        }
Exemplo n.º 2
0
        protected override async void LoadItemsAsync()
        {
            IsBusy = true;

            IEnumerable <Trigger> triggers;

            try
            {
                triggers = await Executer.Execute(() => TriggerProxyServer.GetTriggers(null, null,
                                                                                       null, Select.Extend));
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
                return;
            }
            finally
            {
                IsBusy = false;
            }

            Items = triggers.OrderBy(trigger => trigger.IsOk)
                    .ThenByDescending(trigger => trigger.Priority)
                    .ThenBy(trigger => trigger.Description)
                    .Take(DEFAULT_ITEMS_COUNT)
                    .ToList();
        }
        protected override async void LoadItemsAsync()
        {
            IsBusy = true;

            //uint? hostId = HostId > 0 ? HostId : (uint?)null;
            IEnumerable <Trigger> triggers;

            try
            {
                triggers = await Executer.Execute(() => TriggerProxyServer.GetTriggers(HostId, null,
                                                                                       null, Select.None));
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
                return;
            }
            finally
            {
                IsBusy = false;
            }

            Items = triggers.OrderBy(trigger => trigger.IsOk)
                    .ThenByDescending(trigger => trigger.Priority)
                    .ThenBy(trigger => trigger.Description)
                    .ToList();
        }