Esempio n. 1
0
        public object Any(AllSessions request)
        {
            var sessionKeys = Request.GetCacheClient()
                              .GetKeysStartingWith(IdUtils.CreateUrn <IAuthSession>("")).ToList();
            var allSessions = (Dictionary <string, IAuthSession>)Cache.GetAll <IAuthSession>(sessionKeys);

            return(new AllSessionsResponse {
                SessionKeys = sessionKeys,
                Sessions = allSessions
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor for creating new session entries.
        /// </summary>
        /// <param name="app"></param>
        public SessionViewModel(ApplicationViewModel app)
        {
            _appViewModel = app;
            _previousPage = app.CurrentPageViewModel;
            _session      = new SessionModel();
            Operation     = "Create";

            LoadSessions();
            int nextId = AllSessions.Count == 0 ? 1 : AllSessions.Last <SessionModel>().SessionId + 1;

            _session.SessionId   = nextId;
            _session.VideoList   = new ObservableCollection <VideoModel>();
            _session.Calibration = new CalibrationModel();

            _appViewModel.SessionsViewModel.CurrentSession = _session;
        }
Esempio n. 3
0
        /// <summary>
        /// Constructor for editing or removing an existing session.
        /// </summary>
        /// <param name="app">Application View Model - controller of Navigation</param>
        /// <param name="id">Session ID</param>
        /// <param name="isRemove">Flag: true -> Remove Id, false -> Edit</param>
        public SessionViewModel(ApplicationViewModel app, int id, bool isRemove)
        {
            _appViewModel = app;
            _previousPage = app.CurrentPageViewModel;

            // Finds the session and loads its information onto a local object.
            LoadSessions();
            IEnumerable <SessionModel> s = AllSessions.Where(x => x.SessionId == id);

            _session = s.FirstOrDefault();
            _appViewModel.SessionsViewModel.CurrentSession = _session;

            if (!isRemove)
            {
                Operation = "Edit";
            }
            else
            {
                Operation   = "Remove";
                _buttonText = "Confirm?";
            }
        }
        public SessionFeedbackService()
        {
            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "Inside Open Source Cross Platform .Net", Attended = true
            });

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "From Legacy MVC to Modern MVC"
            }
                );

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "What Every Developer Should Know About SQL Performance"
            }
                );

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "Asynchronous? Parallel? Reactive? Help!"
            }
                );

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "An Introduction to Cross-Platform Mobile Development with Xamarin"
            }
                );
        }
        public static void SeedSessions()
        {
            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "Inside Open Source Cross Platform .Net", TreeRating = 2, SessionId = 1
            });

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "From Legacy MVC to Modern MVC", SessionId = 2
            }
                );

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "What Every Developer Should Know About SQL Performance", SessionId = 3
            }
                );

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "Asynchronous? Parallel? Reactive? Help!", SessionId = 4
            }
                );

            AllSessions.Add(
                new SessionFeedback()
            {
                SessionName = "An Introduction to Cross-Platform Mobile Development with Xamarin", SessionId = 5
            }
                );
        }