Example #1
0
 /// <summary>
 /// Application agent authentication.
 /// </summary>
 /// <param name="agent">Application agent to authenticate.</param>
 /// <param name="password">Password.</param>
 private void Authenticate(AgentInfo agent, string password)
 {
     // Anonimous agent.
     if (agent is AnonymousAgentInfo)
     {
         LogIn(agent);
     }
     // If authentication is ok (wrapper authentication function).
     else if (Logics.Logic.Adaptor.Authenticate(agent, password))
     {
         LogIn(agent);
     }
 }
Example #2
0
        private static void SetAgentActiveFacets(AgentInfo agent)
        {
            List<string> lActiveFacets = new List<string>();
            try
            {
                object[] lParameters = new object[1];
                lParameters[0] = agent;
                lActiveFacets = ExecuteMethod(GetClassTypeName(agent.ClassName), "GetActiveFacets", lParameters) as List<string>;
            }
            catch { }
            lActiveFacets.Add(agent.ClassName);

            agent.AgentFacets = lActiveFacets;
        }
Example #3
0
        /// <summary>
        /// Grant access to the application (LogIn).
        /// </summary>
        /// <param name="agent">Application agent.</param>
        private void LogIn(AgentInfo agent)
        {
            if (agent != null)
            {
                // Set the agent state.
                Logics.Logic.Agent = agent as AgentInfo;

                // Set the agent alias.
                Logics.Logic.Agent.Alias = mAgent.Text;

                // Set that the authentication is correct.
                if (SuccessAthenticate != null)
                {
                    SuccessAthenticate(this, EventArgs.Empty);
                }
                this.Close();
            }
        }