Esempio n. 1
0
        public virtual void NavigateAlerts()
        {
            ExceptionUtility.Try(() =>
            {
                LogUtility.LogMessage("Navigating to Alerts");

                if (User.Current != null && User.Current.HasConfig && DataCache.HasDevices)
                {
                    ProgressUtility.SafeShow("Getting Alerts", () =>
                    {
                        var devices = DataCache.GetAllDevicesFromCache();
                        ServiceContainer.AlertService.RequestGlobalAlerts(devices.Select((d) => d.Id), NavigateAlerts).ContinueWith((r) =>
                        {
                            MainThreadUtility.InvokeOnMain(() =>
                            {
                                ProgressUtility.Dismiss();

                                if (r.Result != null && r.Result.IsSuccessful)
                                {
                                    this.NavigateTo(GlobalAlertListViewController.CreateInstance(), inCurrentNavController: false);
                                }
                                //else {
                                //    AlertUtility.ShowAppError(r.Result?.ErrorBody);
                                //}
                            });
                        });
                    }, true);
                }
            });
        }
Esempio n. 2
0
        public static GlobalAlertListViewController CreateInstance()
        {
            ExceptionUtility.Try(() =>
            {
                if (_instance != null)
                {
                    _instance.Dispose();
                    _instance = null;
                }

                _instance = new GlobalAlertListViewController();
            });

            return(_instance);
        }