Пример #1
0
        public IEnumerable <ColorItem> GetColors(MediaCenterLibraryCache cache)
        {
            McmlDocument     mcml = MediaCenterUtil.GetMcml(cache[this.ResourceLibraryName].GetResource(this.ColorsDocumentName, (object)this.ColorsDocumentResourceType));
            List <ColorItem> list = new List <ColorItem>();

            foreach (PropertyElement propertyElement in mcml.Properties().ColorProperties())
            {
                string text = propertyElement.Value;
                Color  color;
                if (MediaCenterUtil.TryParseColor(text, out color))
                {
                    list.Add(new ColorItem()
                    {
                        Color = color,
                        Name  = propertyElement.Name
                    });
                }
                else
                {
                    Trace.TraceWarning("Could not parse color \"{0}\" from COLORS.MCML.", new object[1]
                    {
                        (object)text
                    });
                }
            }
            return((IEnumerable <ColorItem>)list);
        }