Example #1
0
        /// <summary>
        /// Get the Agent object this CachedAgent represents.
        /// </summary>
        public Agent GetAgent(CachedAgent cachedAgent)
        {
            var agent = new Agent(string.Empty, cachedAgent.Id);

            ModuleManager.HomelessLsosToDispose.Add(agent);
            return(agent);
        }
Example #2
0
        /// <summary>
        /// Creates a CachedAgent object using a given agent ID.
        /// </summary>
        /// <param name="agentId">ID of the agent to get.</param>
        /// <returns>CachedAgent object representing said agent.</returns>
        public CachedAgent CreateCachedAgent(int agentId)
        {
            var methodName = "CreateCachedAgent";

            LogTrace(methodName, "AgentId: {0}", agentId);

            //Get the ISXEVE agent using the passed ID. This is also a long-ass server call.
            //No longer! Not going to be using Index any more.
            var agent = new Agent(String.Empty, agentId);

            if (LavishScriptObject.IsNullOrInvalid(agent))
            {
                return(null);
            }

            //Get its cached representation.
            var cachedAgent = new CachedAgent(agent);

            return(cachedAgent);
        }
Example #3
0
        /// <summary>
        /// Creates a CachedAgent object using a given agent name.
        /// </summary>
        /// <param name="agentName">Name of the agent to get.</param>
        /// <returns>CachedAgent object representing said agent.</returns>
        public CachedAgent CreateCachedAgent(string agentName)
        {
            var methodName = "CreateCachedAgent";

            LogTrace(methodName, "AgentName: {0}", agentName);

            //Get the ISXEVE agent using the passed name. This is a server call
            //and will take ages.
            var agent = new Agent(agentName);

            //Get its cached representation.
            if (LavishScriptObject.IsNullOrInvalid(agent))
            {
                return(null);
            }

            var cachedAgent = new CachedAgent(agent);

            return(cachedAgent);
        }