static void Main(string[] args)
        {
            // publishers
            var rentalStore      = new RentalStore();
            var bolckbasterStore = new BlockbasterStore();


            // subscribers
            var mailService       = new EmailService();
            var pushNorifications = new PushNotifications();

            bolckbasterStore.Notifications += mailService.SendMail;
            bolckbasterStore.Notifications += pushNorifications.SendPushNotification;
            rentalStore.NotifyUsers        += mailService.SendMail;
            rentalStore.NotifyUsers        += pushNorifications.SendPushNotification;

            rentalStore.NotifyUsersVideoEvent += mailService.SendMail;
            rentalStore.NotifyUsersVideoEvent += pushNorifications.SendPushNotification;

            //bolckbasterStore.Notifications -= pushNorifications.SendPushNotification;

            rentalStore.AddNewMovie("Some movie");
            bolckbasterStore.NewMovieRelease("Treto poluvreme");

            Console.ReadLine();
        }
Example #2
0
        private List <PushNotifications> fetchData(SqlCommand cmd)
        {
            SqlConnection            con = cmd.Connection;
            List <PushNotifications> pushnotification = null;

            con.Open();
            using (con)
            {
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    pushnotification = new List <PushNotifications>();
                    while (dr.Read())
                    {
                        PushNotifications uPushNotification = new PushNotifications();
                        uPushNotification.id    = Convert.ToString(dr["id"]);
                        uPushNotification.Title = Convert.ToString(dr["title"]);
                        uPushNotification.Descp = Convert.ToString(dr["desc"]);
                        pushnotification.Add(uPushNotification);
                    }
                    pushnotification.TrimExcess();
                }
            }
            return(pushnotification);
        }
Example #3
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            Xamarin.Forms.Forms.Init(this, bundle);

            LoadApplication(new App());

            if (!PushNotifications.Check(this))
            {
                Finish();
            }

            AndroidKeyboard.Init(this);
            AndroidClipboard.Init(this);
            AndroidSendBackup.Init(this);

            // File opened with this launch?
            //string action = Intent.Action;
            //string type = Intent.Type;

            //if (Intent.ActionView.Equals(action) && !string.IsNullOrEmpty(type))
            //{
            //	Android.Net.Uri fileUri = Intent.Data;

            //	string json = File.ReadAllText(fileUri.Path, Encoding.UTF8);

            //	ApplicationCenter.Receive(json);
            //}

            CheckData(Intent);
        }
        public AppViewModel()
        {
            Cameras = new ObservableCollection <CameraViewModel>();

            PushNotifications.RemoveOldChannel("com.davux.FoscamController3");
            PushNotifications.OnToastNotification += (title, msg) =>
            {
                Debug.WriteLine("Toast: " + msg);
            };
            PushNotifications.ErrorOccurred += msg => MessageBox.Show("Push Notification error: " + msg);
            PushNotifications.ChannelName    = "com.davux.FoscamController";
            PushNotifications.Initialize();
            PushNotifications.TryEnableOnce();

            var SavedConfig = Settings.Get <List <CameraObject> >("cams", null);

            if (SavedConfig == null)
            {
                var NewConfig = new List <CameraObject>();
                NewConfig.Add(new CameraObject
                {
                    URL      = "http://example.com",
                    Title    = "Dave-Home",
                    Timezone = "America/New_york",
                    Password = "******",
                    Username = "******",
                    Version  = CameraObject.CameraVersion.FI8918W,
                });
                NewConfig.Add(new CameraObject
                {
                    URL      = "http://example.com:8080",
                    Title    = "Other",
                    Timezone = "America/Los_Angeles",
                    Username = "******",
                    Password = "******",
                    Version  = CameraObject.CameraVersion.FI8918W,
                });

                Settings.Set("cams", NewConfig);
                SavedConfig = Settings.Get <List <CameraObject> >("cams", null);
            }

            if (SavedConfig == null)
            {
                // Cameras.Add(new CameraViewModel { Title = "TEST", });
            }
            else
            {
                foreach (var config in SavedConfig)
                {
                    Cameras.Add(new CameraViewModel(config));
                }
            }

            Timezones = new List <string> {
                "America/New_York",
                "America/Los_Angeles"
            };
        }
Example #5
0
        public void AddPushNotification(PushNotifications p)
        {
            SqlCommand cmd = new SqlCommand("INSERT INTO [dbo].[push_notifications] ([title],[desc]) VALUES (@Title,@Descp)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Title", (p.Title == null) ? Convert.DBNull : p.Title);
            cmd.Parameters.AddWithValue("@Descp", (p.Descp == null) ? Convert.DBNull : p.Descp);
            executeCommand(cmd);
        }
Example #6
0
        public ActionResult AddPN(AllClasses ac)
        {
            PushNotifications pN = new PushNotifications();

            pN.Title = ac.PushNotification.Title;
            pN.Descp = ac.PushNotification.Descp;
            new BusinessLogic().AddPushNotification(pN);
            return(RedirectToAction("Cms", "Home"));
        }
 public void OnNavigatedTo(NavigationParameters parameters)
 {
     if (!_isRegistered && Settings.AttemptedPush)
     {
         PushNotifications.RegisterForNotifications();
     }
     _isRegistered = PushNotifications.IsRegistered;
     UpdateItems();
 }
Example #8
0
 public void AddPushNotification(string pushNotificationId)
 {
     if (!PushNotifications.Any(a => a.PushNotificationId == pushNotificationId))
     {
         PushNotifications.Add(new PushNotificationInformation {
             PushNotificationId = pushNotificationId
         });
     }
 }
 private async Task PushToFavorites(GeneralSetting serverApiKey, PushNotifications push, Domain.Dto.RewardsOnDate item, List <Domain.Dto.UserDeviceDto> userFavorites)
 {
     if (userFavorites.Count > 0)
     {
         notificationMessage = MessagesConstants.NewOfferFavNotificationMessage;
         notificationTitle   = MessagesConstants.NewOfferFavNotificationTitle;
         await push.SendPushBulk(userFavorites.Select(m => m.UserDeviceId).ToList(), notificationTitle, notificationMessage, "", item.RewardId.ToString(), "favorite", "icon", "offer", 1, (serverApiKey != null ? serverApiKey.Value : ""), true, "Offers", item.MerchantId);
     }
 }
Example #10
0
        // Code to execute when the application is launching (eg, from Start)
        // This code will not execute when the application is reactivated
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            BlueBrush = (SolidColorBrush)Application.Current.Resources["PhoneAccentBrush"]; //BlueColorBrush"];

            APIErrorHandler   = new APIErrorHandler();
            LongPollService   = new LongPollService();
            PushNotifications = new PushNotifications();
            UpdatesService    = new UpdatesService();
            EntityService     = new EntityService();
        }
Example #11
0
        public IActionResult Put([FromBody] Actuator actuator)
        {
            var updatedActuator = repo.Update(actuator);

            if (updatedActuator.Status == RepositoryActionStatus.Updated)
            {
                PushNotifications.DataChangeNotification(updatedActuator, "Actuator state changed");
                return(Ok(updatedActuator));
            }
            return(NoContent());
        }
Example #12
0
        public IActionResult Delete(int id)
        {
            var deletedActuator = repo.Delete(id);

            if (deletedActuator.Status == RepositoryActionStatus.Deleted)
            {
                PushNotifications.DataChangeNotification(deletedActuator, "Actuator removed");
                return(NoContent());
            }
            return(NotFound());
        }
Example #13
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Forms.Init();

            LoadApplication(new App());

            PushNotifications.Initialize(options);
            Client.OS.AppleMailBackup.Initialize(this, options);

            return(base.FinishedLaunching(app, options));
        }
Example #14
0
        public IActionResult Put([FromBody] Unit unit)
        {
            var updatedUnit = repo.Update(unit);

            if (updatedUnit.Status == RepositoryActionStatus.Updated)
            {
                PushNotifications.DataChangeNotification(updatedUnit, "Unit modified");
                return(Ok(updatedUnit));
            }
            return(NoContent());
        }
Example #15
0
        public IActionResult Post([FromBody] Unit unit)
        {
            var newUnit = repo.Create(unit);

            if (newUnit.Status == RepositoryActionStatus.Created)
            {
                PushNotifications.DataChangeNotification(newUnit, "Unit added");
                return(Created(Request.Path + "/" + newUnit.Model.UnitId, newUnit));
            }
            return(BadRequest());
        }
Example #16
0
        public IActionResult Post([FromBody] Actuator actuator)
        {
            var newActuator = repo.Create(actuator);

            if (newActuator.Status == RepositoryActionStatus.Created)
            {
                PushNotifications.DataChangeNotification(actuator, "Actuator added");
                return(Created(Request.Path + "/" + newActuator.Model.ActuatorId, newActuator));
            }
            return(BadRequest());
        }
Example #17
0
    // GLA
    // Loga o usuario no servidor
    private void logUserIn()
    {
        //Debug.Log("email: "+email);
        //Debug.Log("password: "******"error, inform email");
            if (email.IsEmpty())
            {
                Flow.game_native.showMessage("Error", "Please inform an e-mail.");
            }

            return;
        }

        // Up Top Fix Me
        Flow.game_native.startLoading();
        UIManager.instance.blockInput = true;

        //GameConnection conn = new GameConnection(components.url_login, connectionResult);
        GameConnection conn = new GameConnection(Flow.URL_BASE + "login/", connectionResult);

        WWWForm form = new WWWForm();

        form.AddField("app_id", Info.appId);
        form.AddField("email", email);
        form.AddField("password", password);
        form.AddField("device", SystemInfo.deviceUniqueIdentifier.Replace("-", ""));

        string device_push = PushNotifications.getPushDevice();

        if (device_push != null)
        {
            form.AddField("device_push", device_push);
        }
        // Info.GetAppType() = Free, Pay, Custom1, Custom2, Custom3
        form.AddField("app_version", Info.version.ToString());
        form.AddField("app_type", Info.appType.ToString());

#if UNITY_EDITOR
        form.AddField("app_platform", "UnityEditor");
#elif UNITY_IPHONE
        form.AddField("app_platform", "iOS");
#elif UNITY_ANDROID
        form.AddField("app_platform", "Android");
#elif UNITY_WEBPLAYER
        form.AddField("app_platform", "Facebook");
#endif

        conn.connect(form);
        //Debug.Log("conecta novamente");
    }
Example #18
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 19;
         foreach (var foo in PushNotifications.Select(p => p.ShipmentKey).Union(PushNotifications.Select(p => p.InventoryKey)))
         {
             hash = hash * 31 + foo.GetHashCode();
         }
         return(hash);
     }
 }
Example #19
0
        public IActionResult Delete(int id)
        {
            var deletedUnit = repo.Delete(id);

            if (deletedUnit.Status == RepositoryActionStatus.Deleted)
            {
                PushNotifications.DataChangeNotification(deletedUnit, "Unit removed");
                return(NoContent());
            }
            else
            {
                return(NotFound());
            }
        }
Example #20
0
        public IActionResult Post([FromBody] SensorLog sensorlog)
        {
            var newSensorLog = repo.AddSensorValue(sensorlog);

            if (newSensorLog.Status == RepositoryActionStatus.Created)
            {
                PushNotifications.DataChangeNotification(sensorlog, "Sensor data logged");
                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
Example #21
0
        public IActionResult Post([FromBody] AlarmLog alarmlogvalue)
        {
            var newAlarmLogValue = repo.AddAlarmLogValue(alarmlogvalue);

            if (newAlarmLogValue.Status == RepositoryActionStatus.Created)
            {
                PushNotifications.AlarmNotification(alarmlogvalue);
                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
Example #22
0
        public bool Equals(UserMessage other) // Compare the ShipmentKeys and the InventoryKeys
        {
            if (other == null)
            {
                return(false);
            }

            var keys      = PushNotifications.Select(p => p.ShipmentKey).Concat(PushNotifications.Select(p => p.InventoryKey)).ToList();
            var otherkeys = other.PushNotifications.Select(p => p.ShipmentKey).Concat(other.PushNotifications.Select(p => p.InventoryKey)).ToList();

            var comparer1 = keys.Except(otherkeys);
            var comparer2 = otherkeys.Except(keys);

            return(Message == other.Message && !comparer1.Any() && !comparer2.Any());
        }
Example #23
0
        // Code to execute when the application is activated (brought to foreground)
        // This code will not execute when the application is first launched
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            if (LongPollService == null)
            {
                LongPollService = new LongPollService();
            }

            if (PushNotifications == null)
            {
                PushNotifications = new PushNotifications();
            }

            if (APIErrorHandler == null)
            {
                APIErrorHandler = new APIErrorHandler();
            }

            if (UpdatesService == null)
            {
                UpdatesService = new UpdatesService();
            }

            if (EntityService == null)
            {
                EntityService = new EntityService();
            }

            if (!_settings.IsPushOn)
            {
                // If timer has gone, so we can turn on Push notifications.
                if (DateTime.Now >= _settings.PushTurnOnTime)
                {
                    _settings.IsPushOn = true;
                    App.Current.PushNotificationsSwitchTimer.Dispose();
                }
                else
                {
                    // Turn on push notifications when time occurs.
                    TimeSpan temp = _settings.PushTurnOnTime - DateTime.Now;

                    PushNotificationsSwitchTimer = new Timer(state =>
                    {
                        _settings.IsPushOn = true;
                        App.Current.PushNotificationsSwitchTimer.Dispose();
                    }, null, Convert.ToInt32(temp.TotalMilliseconds), -1);
                }
            }
        }
Example #24
0
    // Obtem o token com o servidor
    protected void requestToken()
    {
        if (!Info.HasConnection(true))
        {
            Debug.Log("sem conexao");
            return;
        }

        Flow.game_native.startLoading();
        UIManager.instance.blockInput = true;

        // Criar o codigo de autenticacao
        authentication = System.Guid.NewGuid().ToString();

        // Chama a pagina do Facebook no nosso servidor
        string fb_login_url = Flow.URL_BASE + "login/facebook/";

        fb_login_url += "?app_id=" + Info.appId;
        fb_login_url += "&authentication=" + authentication;
        fb_login_url += "&device=" + SystemInfo.deviceUniqueIdentifier.Replace("-", "");

        string device_push = PushNotifications.getPushDevice();

        if (device_push != null)
        {
            fb_login_url += "&device_push=" + WWW.EscapeURL(device_push);
        }
        fb_login_url += "&app_version=" + Info.version.ToString();
        fb_login_url += "&app_type=" + Info.appType.ToString();

#if UNITY_EDITOR
        fb_login_url += "&app_platform=UnityEditor";
#elif UNITY_WEBPLAYER
        fb_login_url += "&app_platform=Facebook";
#elif UNITY_ANDROID
        fb_login_url += "&app_platform=Android";
#elif UNITY_IPHONE
        fb_login_url += "&app_platform=iOS";
#endif

        Flow.game_native.openUrlInline(fb_login_url);


        // Obtem a resposta do servidor
        StartCoroutine(getFacebookInfo());
    }
Example #25
0
        private async Task <List <Domain.Dto.UserDeviceDto> > WonRewardsScheduleRefactorInside(List <Domain.Dto.RewardsOnDate> userCompletedRewards, Domain.Dto.ProgramInfoDto prg, List <Domain.Dto.UserDeviceDto> userDeviceIds)
        {
            if (userDeviceIds.Count > 0)
            {
                var serverApiKeyForWonRewards       = (await _setting.GetGeneratSettingValueByKeyGroup(Constants.FireBaseConstants.FireBaseServerKey)).FirstOrDefault();
                PushNotifications pushForWinRewards = new PushNotifications();
                var usrNotifyForWinRewards          = await _userNotificationSettingsService.GetUserNotificationSettingByNotificaction(userDeviceIds.Select(m => m.Id).ToList(), (int)NotificationSettingsEnum.Awards);

                if (usrNotifyForWinRewards.Count > 0)
                {
                    userDeviceIds = userDeviceIds.Where(x => usrNotifyForWinRewards.Contains(x.Id)).ToList();
                    if (userDeviceIds.Count > 0)
                    {
                        await WonRewardsScheduleRefactorInsideAgain(userCompletedRewards, prg, userDeviceIds, serverApiKeyForWonRewards, pushForWinRewards);
                    }
                }
            }
            return(userDeviceIds);
        }
Example #26
0
    // Abre a janela de login do usuario com o Facebook
    public void login(object state, LoginCallback callback)
    {
        if (!Info.HasConnection(true))
        {
            return;
        }

        if (Info.IsWeb())
        {
            Application.ExternalEval("getUserInfo()");
            return;
        }

        // Criar o codigo de autenticacao
        string auth = System.Guid.NewGuid().ToString();

        // Chama a pagina do Facebook no nosso servidor
        string fb_login_url = Flow.URL_BASE + "login/facebook/";

        fb_login_url += "?app_id=" + Info.appId;
        fb_login_url += "&authentication=" + auth;
        fb_login_url += "&device=" + SystemInfo.deviceUniqueIdentifier.Replace("-", "");

        if (Save.HasKey(PlayerPrefsKeys.TOKEN.ToString()))
        {
            fb_login_url += "&token=" + WWW.EscapeURL(Save.GetString(PlayerPrefsKeys.TOKEN.ToString()));
        }

        string device_push = PushNotifications.getPushDevice();

        if (device_push != null)
        {
            fb_login_url += "&device_push=" + WWW.EscapeURL(device_push);
        }

        // Up Top Fix Me (dialog)
        //GameGUI.game_native.openUrlInline(fb_login_url);
        Flow.game_native.openUrlInline(fb_login_url);         // GLA

        // Obtem a resposta do servidor
        //GameGUI.components.StartCoroutine(getLoginResult(auth, state, callback));
        Flow.config.GetComponent <ConfigManager>().StartCoroutine(getLoginResult(auth, state, callback));
    }
Example #27
0
        void SetMessageNotifyPref(NotificationType type, int account)
        {
            if (messageFirstChange)
            {
                messageFirstChange = false;
                return;
            }

            Config.Accounts[account].Preferences.MessagesPreferences = type;

            if (type == NotificationType.None)
            {
                PushNotifications.UnregisterPushChannel(Config.Accounts[account], "messages");
            }
            else
            {
                PushNotifications.AutoRegisterForNotifications();
            }
        }
Example #28
0
        protected async override void OnLaunched(LaunchActivatedEventArgs args)
        {
            var rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }
            }

            if (Window.Current.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter

                var setup = new Setup(rootFrame);
                setup.Initialize();

                await AskForADCredentialsAsync();

                Window.Current.Content = new Views.MainView(rootFrame, Mvx.Resolve <IMvxMessenger>());

                var start = Mvx.Resolve <Cirrious.MvvmCross.ViewModels.IMvxAppStart>();
                start.Start();

                ((MainViewModel)((Views.MainView)Window.Current.Content).DataContext).NavigateToHomeCommand.Execute();
            }
            // Ensure the current window is active
            Window.Current.Activate();
            PushNotifications.UploadChannel();
        }
Example #29
0
        public void SetConfig(CameraObject conf)
        {
            Title    = conf.Title;
            URL      = conf.URL;
            Username = conf.Username;
            Password = conf.Password;

            Config        = conf;
            Config.Update = this;

            Controller = new IPCameraController(URL, Username, Password);

            if (IsRunning)
            {
                Stop();
                Start();
            }

            if (string.IsNullOrEmpty(conf.Timezone))
            {
                // FIXME:  we shouldn't have this problem, but possibly still do.
                conf.Timezone = "America/New_York";
            }

            // for com.davux.FoscamController, options is defined as:
            // <Camera snapshot URL> [<PHP Timezone> <Tile Link Page>]
            // just URL is v1 appcompat

            PushNotifications.RegisterApp(PushNotifications.ChannelName, Title,
                                          string.Format("{0} {1} {2}", Controller.GetSnapshotURL(),
                                                        conf.Timezone, new Uri(Uri.EscapeUriString(String.Format("/Camera.xaml?Title={0}",
                                                                                                                 conf.Title)), UriKind.Relative).ToString()),
                                          (success, message) =>
            {
                Debug.WriteLine("RegisterApp: " + success + " " + message);
            });
        }
 /// <summary>
 /// Event-Handler, der ausgeführt wird, wenn vom PushNotificationManager ein
 /// ReceivedAnnouncement-Event verschickt wird.
 /// </summary>
 /// <param name="sender">Der Sender des Events, d.h. hier der PushNotificationManager.</param>
 /// <param name="e">Eventparameter.</param>
 private async void PushManager_ReceivedConversationMessage(object sender, PushNotifications.EventArgClasses.ConversationRelatedEventArgs e)
 {
     if (groupDetailsViewModel != null)
     {
         // Ausführung auf UI-Thread abbilden.
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
             Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
             {
                 await groupDetailsViewModel.UpdateNumberOfUnreadConversationMessagesAsync();
             });
     }
 }
 /// <summary>
 /// Event-Handler, der ausgeführt wird, wenn vom PushNotificationManager ein 
 /// ChannelChanged-Event verschickt wird.
 /// </summary>
 /// <param name="sender">Der Sender des Events, d.h. hier der PushNotificationManager.</param>
 /// <param name="e">Eventparameter.</param>
 async void pushManager_ChannelChanged(object sender, PushNotifications.EventArgClasses.ChannelChangedEventArgs e)
 {
     if (moderatorHomescreenViewModel != null)
     {
         // Ausführung auf UI-Thread abbilden.
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
             Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
             {
                 await moderatorHomescreenViewModel.PerformViewUpdateOnChannelChangedEventAsync(e.ChannelId);
             });
     }
 }
Example #32
0
        private async Task WonRewardsScheduleRefactorInsideAgain(List <Domain.Dto.RewardsOnDate> userCompletedRewards, Domain.Dto.ProgramInfoDto prg, List <Domain.Dto.UserDeviceDto> userDeviceIds, GeneralSetting serverApiKey, PushNotifications push)
        {
            foreach (var item in userCompletedRewards)
            {
                if (item.ProgramId == prg.id)
                {
                    try
                    {
                        notificationMessage = MessagesConstants.WonRewardNotificationMessage + item.MerchantName;
                        notificationTitle   = MessagesConstants.WonRewardNotificationTitle;

                        await push.SendPushBulk(userDeviceIds.Select(m => m.UserDeviceId).ToList(), notificationTitle, notificationMessage, "", item.RewardId.ToString(), "awards", "icon", "awards", 1, (serverApiKey != null ? serverApiKey.Value : ""), true, "CompleteRewards", item.MerchantId);

                        await _userPushedNotificationService.AddAsync(new UserPushedNotifications()
                        {
                            notificationMessage = notificationMessage,
                            notificationTitle   = notificationTitle,
                            notificationType    = (int)NotificationSettingsEnum.Awards,
                            referenceId         = item.RewardId,
                            createdBy           = item.CreatedBy,
                            modifiedBy          = item.CreatedBy,
                            ProgramId           = item.ProgramId,
                            IsRedirect          = true,
                            NotificationSubType = "CompleteRewards",
                            CustomReferenceId   = item.MerchantId
                        });
                    }
                    catch (Exception ex)
                    {
                        HttpContext.RiseError(new Exception(string.Concat("API := (Scheduler := GeSchedulerForOffersNRewards)", ex.Message, " Stack Trace : ", ex.StackTrace, " Inner Exception : ", ex.InnerException)));
                    }
                }
            }
        }
 /// <summary>
 /// Behandelt abstimmungsbezogene Events, die eine Aktualisierung der angezeigten Abstimmungen erfordern.
 /// Wenn es sich bei der betroffenen Gruppe um die aktuell angezeigte Gruppe handelt, so wird diese Aktualisierung angestoßen.
 /// </summary>
 /// <param name="sender">Der Sender des Events, d.h. hier der PushNotificationManager.</param>
 /// <param name="e">Eventparameter.</param>
 private async void pushManager_ReloadBallotList(object sender, PushNotifications.EventArgClasses.BallotRelatedEventArgs e)
 {
     if (groupDetailsViewModel != null &&
         groupDetailsViewModel.SelectedGroup != null &&
         groupDetailsViewModel.SelectedGroup.Id == e.GroupId)
     {
         // Ausführung auf UI-Thread abbilden.
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
             Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
             {
                 groupDetailsViewModel.ReloadBallotCollection();
             });
     }
 }
 /// <summary>
 /// Event-Handler, der ausgeführt wird, wenn vom PushNotificationManager ein
 /// ReceivedAnnouncement-Event verschickt wird.
 /// </summary>
 /// <param name="sender">Der Sender des Events, d.h. hier der PushNotificationManager.</param>
 /// <param name="e">Eventparameter.</param>
 private async void PushManager_ReceivedConversationMessage(object sender, PushNotifications.EventArgClasses.ConversationRelatedEventArgs e)
 {
     if (conversationDetailsViewModel != null && 
         conversationDetailsViewModel.SelectedConversation != null && 
         conversationDetailsViewModel.SelectedConversation.Id == e.ConversationId)
     {
         // Ausführung auf UI-Thread abbilden.
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
             Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
             {
                 conversationDetailsViewModel.UpdateConversationMessagesCollection();
             });
     }
 }
 /// <summary>
 /// Event-Handler, der von verschiedenen gruppen-basierten Events genutzt werden kann. Der Handler
 /// stößt die Aktualisierung der vom Event betroffenen Gruppe an.
 /// </summary>
 /// <param name="sender">Der Sender des Events, d.h. hier der PushNotificationManager.</param>
 /// <param name="e">Eventparameter.</param>
 async void pushManager_GroupUpdateRequired(object sender, PushNotifications.EventArgClasses.GroupRelatedEventArgs e)
 {
     if (homescreenViewModel != null)
     {
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
             Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
             {
                 homescreenViewModel.UpdateIndividualGroupInCollection(e.GroupId);
             });
     }
 }
 /// <summary>
 /// Behandelt abstimmungsbezogene Events, die eine Aktualisierung der Detailsseite erfordern.
 /// Wenn es sich bei der betroffenen Gruppe um die aktuell angezeigte Gruppe handelt und 
 /// die geladene Abstimmung der betroffenen Abstimmung entspricht, so wird diese Aktualisierung angestoßen.
 /// </summary>
 /// <param name="sender">Der Sender des Events, d.h. hier der PushNotificationManager.</param>
 /// <param name="e">Eventparameter.</param>
 private async void pushManager_ReloadBallotDetailsView(object sender, PushNotifications.EventArgClasses.BallotRelatedEventArgs e)
 {
     if (ballotDetailsViewModel != null &&
         ballotDetailsViewModel.AffectedGroup != null && ballotDetailsViewModel.SelectedBallot != null &&
         ballotDetailsViewModel.AffectedGroup.Id == e.GroupId && 
         ballotDetailsViewModel.SelectedBallot.Id == e.BallotId)
     {
         // Ausführung auf UI-Thread abbilden.
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
             Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
             {
                 await ballotDetailsViewModel.LoadBallotAsync(e.GroupId, e.BallotId);
             });
     }
 }