Ejemplo n.º 1
0
 /// <exclude />
 protected IEnumerable <string> GetConsoleIdsOpenedByUser(string username)
 {
     if (UserSettings.Username == username)
     {
         string currentConsoleId = GetCurrentConsoleId();
         return(ConsoleFacade.GetConsoleIdsByUsername(username).Union(new[] { currentConsoleId }));
     }
     else
     {
         return(ConsoleFacade.GetConsoleIdsByUsername(username));
     }
 }
        private void IsUserLoggedOn(object sender, System.Workflow.Activities.ConditionalEventArgs e)
        {
            DataEntityToken dataEntityToken = (DataEntityToken)this.EntityToken;

            IUser user = (IUser)dataEntityToken.Data;

            string selectedActiveLocaleName = (user.Username != UserSettings.Username ?
                                               this.GetBinding <string>("ActiveLocaleName") :
                                               UserSettings.ActiveLocaleCultureInfo.ToString());

            if (selectedActiveLocaleName != null)
            {
                CultureInfo selectedActiveLocale = CultureInfo.CreateSpecificCulture(selectedActiveLocaleName);

                if (!UserSettings.GetCurrentActiveLocaleCultureInfo(user.Username).Equals(selectedActiveLocale))
                {
                    e.Result = ConsoleFacade.GetConsoleIdsByUsername(user.Username).Any();
                    return;
                }
            }

            e.Result = false;
        }
Ejemplo n.º 3
0
        /// <exclude />
        protected IEnumerable <string> GetConsoleIdsOpenedByCurrentUser()
        {
            string currentConsoleId = GetCurrentConsoleId();

            return(ConsoleFacade.GetConsoleIdsByUsername(UserSettings.Username).Union(new[] { currentConsoleId }));
        }