Пример #1
0
        protected override void SetOverride(XElement element)
        {
            if (element is null)
            {
                throw new System.ArgumentNullException(nameof(element));
            }

            MatchAwardDataOverride matchAwardDataOverride = new MatchAwardDataOverride();

            string?cAwardId = element.Attribute("id")?.Value;

            foreach (XElement dataElement in element.Elements())
            {
                string elementName    = dataElement.Name.LocalName;
                string?valueAttribute = dataElement.Attribute("value")?.Value;

                if (string.IsNullOrEmpty(valueAttribute))
                {
                    continue;
                }

                switch (elementName)
                {
                case "Id":
                    matchAwardDataOverride.IdOverride = (true, valueAttribute);
                    break;

                case "MVPScreenImageFileNameOriginal":
                    matchAwardDataOverride.MVPScreenImageFileNameOriginalOverride = (true, valueAttribute);
                    break;

                case "MVPScreenImageFileName":
                    matchAwardDataOverride.MVPScreenImageFileNameOverride = (true, valueAttribute);
                    break;

                case "ScoreScreenImageFileNameOriginal":
                    matchAwardDataOverride.ScoreScreenImageFileNameOriginalOverride = (true, valueAttribute);
                    break;

                case "ScoreScreenImageFileName":
                    matchAwardDataOverride.ScoreScreenImageFileNameOverride = (true, valueAttribute);
                    break;

                case "Description":
                    matchAwardDataOverride.DescriptionOverride = (true, valueAttribute);
                    break;
                }
            }

            if (!string.IsNullOrEmpty(cAwardId) && !DataOverridesById.ContainsKey(cAwardId))
            {
                DataOverridesById.Add(cAwardId, matchAwardDataOverride);
            }
        }
Пример #2
0
        protected override void SetOverride(XElement element)
        {
            MatchAwardDataOverride matchAwardDataOverride = new MatchAwardDataOverride();

            string cAwardId = element.Attribute("id").Value;

            foreach (XElement dataElement in element.Elements())
            {
                string elementName    = dataElement.Name.LocalName;
                string valueAttribute = dataElement.Attribute("value")?.Value;

                switch (elementName)
                {
                case "Id":
                    if (!string.IsNullOrEmpty(valueAttribute))
                    {
                        matchAwardDataOverride.IdOverride = (true, valueAttribute);
                    }
                    break;

                case "MVPScreenImageFileNameOriginal":
                    if (!string.IsNullOrEmpty(valueAttribute))
                    {
                        matchAwardDataOverride.MVPScreenImageFileNameOriginalOverride = (true, valueAttribute);
                    }
                    break;

                case "MVPScreenImageFileName":
                    if (!string.IsNullOrEmpty(valueAttribute))
                    {
                        matchAwardDataOverride.MVPScreenImageFileNameOverride = (true, valueAttribute);
                    }
                    break;

                case "ScoreScreenImageFileNameOriginal":
                    if (!string.IsNullOrEmpty(valueAttribute))
                    {
                        matchAwardDataOverride.ScoreScreenImageFileNameOriginalOverride = (true, valueAttribute);
                    }
                    break;

                case "ScoreScreenImageFileName":
                    if (!string.IsNullOrEmpty(valueAttribute))
                    {
                        matchAwardDataOverride.ScoreScreenImageFileNameOverride = (true, valueAttribute);
                    }
                    break;

                case "Description":
                    if (!string.IsNullOrEmpty(valueAttribute))
                    {
                        matchAwardDataOverride.DescriptionOverride = (true, valueAttribute);
                    }
                    break;
                }
            }

            if (!DataOverridesById.ContainsKey(cAwardId))
            {
                DataOverridesById.Add(cAwardId, matchAwardDataOverride);
            }
        }