Beispiel #1
0
        /// <summary>
        /// Add a new sesion to the static list of sessions of the class
        /// Save the list in the corresponding file
        /// </summary>
        /// <param name="session">new session to add</param>
        public async static void SaveSession(Session session)
        {
            try
            {
                if (Sessions == null)
                {
                    Sessions = new List <Session>();
                }

                Sessions = await WSConsumer.AddSession(session, user.Id);
            }
            catch (Exception e)
            {
                DependencyService.Get <IMessage>().longtime("ERR: " + e.Message);
                if (Sessions == null)
                {
                    Sessions = new List <Session>();
                }

                Sessions.Add(session);
            }
            SaveList(Sessions, sessionFile);
        }