public void LoadNotifications() { Logger.Log("LoadNotifications"); // build ung adapter model objects // List<string> messages = new List <string> () // { // "hehehe1","hehehe2", // "hehehe3","hehehe4", // "hehehe5","hehehe6", // }; // // List <ReactiveAdapterModel> dataSet = // messages.Select ((m, i) => new ReactiveAdapterModel() {Title = $"title {i + 1}", Message = m}).ToList (); // bool allowed = cliService.AllowMbesAttempt(cliSession.clientId); // if(allowed) create model List <NotificationAdapterModel> dataSet = new List <NotificationAdapterModel> (NotificationCount); // client is allowed to take the mbes so we add it first if (loggedClient.MbesAllowAttempt) { NotificationAdapterModel model = new NotificationAdapterModel() { Title = "Take the MBES-21", Message = "You are required to take the MBES-21 and answer as honestly as possible.", HasAction = true }; model.ActionClicked += StartMbesActivity; dataSet.Add(model); } // add random reminders to the dataset // 3 notifs, either 0 - mbes | 3 - reminders, or 1 - mbes | 2 - reminders List <NotificationAdapterModel> reminders = GetReminders; int count = reminders.Count; int randInt = random.Next(count); List <int> randIndeces = new List <int> (); for (int i = dataSet.Count; i < NotificationCount; i++) { // consecutive items makukuha, last<-->first connected int index = (randInt + i) % count; dataSet.Add(reminders[index]); } // List <NotificationAdapterModel> dataSets = new List <NotificationAdapterModel> () {model};//, model, model, model, model, model, model, model, model, model, model, model, model}; view.DisplayNotifications(dataSet); }
public void LoadNotifications() { // Behavior NotificationAdapterModel notifBehaviorList = new NotificationAdapterModel() { Title = "View Behavior List", Message = "View this client's behavior graphs as well as statistics for each graph", HasAction = true }; notifBehaviorList.ActionClicked += ViewClientBehaviorList; // WeeklyReport NotificationAdapterModel notifWeekly = new NotificationAdapterModel() { Title = "View Weekly Reports", Message = "View this client's weekly reports and statistics", HasAction = true }; notifWeekly.ActionClicked += ViewClientWeeklyReport; // SurveyReport NotificationAdapterModel notifSurvey = new NotificationAdapterModel() { Title = "View Survey Reports", Message = "View this client's survey scores and report", HasAction = true }; notifSurvey.ActionClicked += ViewClientSurveyReport; // add it to the data set List <NotificationAdapterModel> dataSet = new List <NotificationAdapterModel> () { notifBehaviorList, notifWeekly, notifSurvey }; view.DisplayNotifications(dataSet); }