예제 #1
0
        internal void OnDeserializedMethod(StreamingContext context)
        {
            if (KeywordIds == null)
            {
                return;
            }
            // TODO: Can be put into json.

            var tauntExceptions = new List <int> {
                48100, 61028, 63623, 763, 1003, 43022, 63622, 63619, 48100
            };

            HasTaunt = KeywordIds.Contains(MinionKeyword.Taunt) && !tauntExceptions.Contains(Id);

            var rebornExceptions = new List <int>();

            HasReborn = KeywordIds.Contains(MinionKeyword.Reborn) && !rebornExceptions.Contains(Id);

            var divineShieldExceptions = new List <int> {
                61072, 38740, 60629
            };

            HasDivineShield = KeywordIds.Contains(MinionKeyword.DivineShield) && !divineShieldExceptions.Contains(Id);

            HasWindfury = KeywordIds.Contains(MinionKeyword.Windfury);
        }
예제 #2
0
        public void PopulateDropDownLists(
            IEnumerable <Document> documents,
            IEnumerable <Classification> classifications,
            IEnumerable <Keyword> keywords)
        {
            AvailableDocuments.AddRange(documents
                                        .OrderBy(d => d.Id)
                                        .Select(d => new SelectListItem
            {
                Value    = d.Id.ToString(),
                Text     = d.CatalogCode + " - " + d.Title,
                Selected = d.Id == Image.DocumentId
            }));

            AvailableKeywords.AddRange(keywords
                                       .OrderBy(k => k.Id)
                                       .ToList()
                                       .Select(k => new TranslatedViewModel <Keyword, KeywordTranslation>(k))
                                       .Select(k => new SelectListItem
            {
                Value    = k.Entity.Id.ToString(),
                Text     = k.Translation.Value,
                Selected = KeywordIds.Contains(k.Entity.Id)
            }));

            AvailableClassifications.AddRange(classifications
                                              .OrderBy(c => c.Id)
                                              .ToList()
                                              .Select(c => new TranslatedViewModel <Classification, ClassificationTranslation>(c))
                                              .Select(c => new SelectListItem
            {
                Value    = c.Entity.Id.ToString(),
                Text     = c.Translation.Value,
                Selected = Image.ClassificationId == c.Entity.Id
            }));
        }