Пример #1
0
        /// <summary>
        /// EVE Attributes
        /// </summary>
        /// <returns><c>Bag</c> of Attributes</returns>
        internal static Bag<DgmAttributeTypes> Attributes()
        {
            var list = new IndexedList<DgmAttributeTypes>();

            foreach (dgmAttributeTypes attribute in Context.dgmAttributeTypes)
            {
                var item = new DgmAttributeTypes
                               {
                                   ID = attribute.attributeID,
                                   CategoryID = attribute.categoryID,
                                   Description = attribute.description.Clean(),
                                   DisplayName = attribute.displayName.Clean(),
                                   IconID = attribute.iconID,
                                   Name = attribute.attributeName.Clean(),
                                   UnitID = attribute.unitID
                               };

                if (attribute.defaultValue.HasValue)
                    item.DefaultValue = attribute.defaultValue.Value.ToString();

                if (attribute.highIsGood.HasValue)
                    item.HigherIsBetter = attribute.highIsGood.Value;

                list.Items.Add(item);
            }

            return new Bag<DgmAttributeTypes>(list);
        }
Пример #2
0
        /// <summary>
        /// Dogma Attribute Types.
        /// </summary>
        /// <returns><c>BagCollection</c> of Dogma Attribute Types.</returns>
        private static BagCollection<DgmAttributeTypes> AttributeTypes()
        {
            IndexedCollection<DgmAttributeTypes> collection = new IndexedCollection<DgmAttributeTypes>();

            foreach (dgmAttributeTypes attribute in s_context.dgmAttributeTypes)
            {
                DgmAttributeTypes item = new DgmAttributeTypes
                {
                    ID = attribute.attributeID,
                    CategoryID = attribute.categoryID,
                    Description = attribute.description,
                    DisplayName = attribute.displayName,
                    IconID = attribute.iconID,
                    Name = attribute.attributeName,
                    UnitID = attribute.unitID,
                };

                item.Description = item.Description.Clean();
                item.DisplayName = item.DisplayName.Clean();
                item.Name = item.Name.Clean();

                if (attribute.defaultValue.HasValue)
                    item.DefaultValue = attribute.defaultValue.Value.ToString(CultureInfo.InvariantCulture);

                if (attribute.published.HasValue)
                    item.Published = attribute.published.Value;

                if (attribute.highIsGood.HasValue)
                    item.HigherIsBetter = attribute.highIsGood.Value;

                collection.Items.Add(item);
            }

            // Set properties total count
            PropertiesTotalCount = collection.Items.Count;

            return collection.ToBag();
        }