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); }
/// <summary> /// Return an owner /// </summary> /// <param name="ownerId"></param> /// <returns></returns> public DirectOwner GetOwner(long ownerId) { return(DirectOwner.GetOwner(this, ownerId)); }