Esempio n. 1
0
        internal static DirectAgent GetAgentByName(DirectEve directEve, string name)
        {
            var agentsById = directEve.GetLocalSvc("agents").Attribute("allAgentsByID").Attribute("items").ToDictionary <long>();

            foreach (var agent in agentsById)
            {
                var owner = DirectOwner.GetOwner(directEve, agent.Key);
                if (owner.Name != name)
                {
                    continue;
                }

                return(GetAgentById(directEve, agent.Key));
            }

            return(null);
        }
Esempio n. 2
0
 /// <summary>
 ///     Return an owner
 /// </summary>
 /// <param name="ownerId"></param>
 /// <returns></returns>
 public DirectOwner GetOwner(long ownerId)
 {
     return(DirectOwner.GetOwner(this, ownerId));
 }