Ejemplo n.º 1
0
        public static TMUser        tmUser_FromEmail(this TM_UserData userData, string eMail)
        {
            if (userData.isNull() || eMail.isNull())
            {
                return(null);
            }
            lock (userData.TMUsers)
            {
                var tmUsers = userData.TMUsers.where ((tmUser) => tmUser.EMail == eMail);

                switch (tmUsers.size())
                {
                case 0:
                    //"Could not find TM User with email'{0}'".error(eMail);
                    return(null);

                case 1:
                    return(tmUsers.first());

                default:
                    "There were multiple users resolved to the email '{0}', so returning null".error(eMail);
                    return(null);
                }
            }
        }
Ejemplo n.º 2
0
 public static bool tmConfig_SetCurrent(this TM_UserData userData, TMConfig tmConfig)
 {
     if (userData.isNull() || tmConfig.isNull())
     {
         return(false);
     }
     TMConfig.Current = tmConfig;
     return(userData.event_TM_Config_Changed());   //return userData.tmConfig_Save();
 }
Ejemplo n.º 3
0
 public static TMUser        tmUser(this TM_UserData userData, int userId)
 {
     if (userData.isNull())
     {
         return(null);
     }
     lock (userData.TMUsers)
     {
         return(userData.TMUsers.Where((tmUser) => tmUser.UserID == userId).first());
     }
 }
Ejemplo n.º 4
0
 public static TMUser        tmUser(this TM_UserData userData, string userName)
 {
     if (userData.isNull())
     {
         return(null);
     }
     lock (userData.TMUsers)
     {
         return(userData.TMUsers.Where((tmUser) => tmUser.UserName == userName).first());
     }
 }