Beispiel #1
0
        /// <summary>
        /// Agent Agents.
        /// </summary>
        /// <returns><c>BagCollection</c> of Agent Agents.</returns>
        private static BagCollection <AgtAgents> Agents()
        {
            IndexedCollection <AgtAgents> collection = new IndexedCollection <AgtAgents>();

            foreach (agtAgents agent in s_context.agtAgents)
            {
                AgtAgents item = new AgtAgents
                {
                    ID = agent.agentID,
                };

                if (agent.divisionID.HasValue)
                {
                    item.DivisionID = agent.divisionID.Value;
                }

                if (agent.locationID.HasValue)
                {
                    item.LocationID = agent.locationID.Value;
                }

                if (agent.level.HasValue)
                {
                    item.Level = agent.level.Value;
                }

                if (agent.quality.HasValue)
                {
                    item.Quality = agent.quality.Value;
                }

                if (agent.agentTypeID.HasValue)
                {
                    item.AgentTypeID = agent.agentTypeID.Value;
                }

                if (agent.isLocator.HasValue)
                {
                    item.IsLocator = agent.isLocator.Value;
                }

                collection.Items.Add(item);
            }

            return(collection.ToBag());
        }
Beispiel #2
0
        /// <summary>
        /// EVE Agents
        /// </summary>
        /// <returns><c>Bag</c> of EVE Agents</returns>
        internal static Bag <AgtAgents> Agents()
        {
            var list = new IndexedList <AgtAgents>();

            foreach (agtAgents agent in Context.agtAgents)
            {
                var item = new AgtAgents
                {
                    ID         = agent.agentID,
                    LocationID = agent.locationID.Value,
                    Level      = agent.level.Value
                };

                if (agent.quality.HasValue)
                {
                    item.Quality = agent.quality.Value;
                }

                list.Items.Add(item);
            }

            return(new Bag <AgtAgents>(list));
        }