コード例 #1
0
        public ImageSet GetImages(string id)
        {
            if (this.managerImages == null)
            {
                this.managerImages = (IDictionary <string, ImageSet>) new Dictionary <string, ImageSet>();
                string      @string     = ResourceExtensions.GetString(this.Resources["Microsoft.MediaCenter.Shell.dll"].GetResource("IMAGES.MCML", (object)10), Encoding.UTF8);
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(@string);
                XmlNodeList childNodes = xmlDocument.DocumentElement.ChildNodes;
                for (int index = 0; index < childNodes.Count; ++index)
                {
                    XmlElement element = childNodes[index] as XmlElement;
                    if (element != null)
                    {
                        ImageSet imageSet = ImageSet.FromXml(this.Resources, element);
                        if (imageSet.Name != null)
                        {
                            this.managerImages[imageSet.Name] = imageSet;
                        }
                    }
                }
            }
            ImageSet imageSet1;

            this.managerImages.TryGetValue(id, out imageSet1);
            if (imageSet1 == null)
            {
                Trace.TraceWarning("Could not find image set {0}.", new object[1]
                {
                    (object)id
                });
            }
            return(imageSet1);
        }
コード例 #2
0
ファイル: Windows7QuickLink.cs プロジェクト: WildGenie/MCS
        protected override void Load()
        {
            string attribute = this.LinkElement.GetAttribute("Description");

            this.Title           = MediaCenterUtil.GetStringResource(this.Manager.Resources, attribute, false) ?? attribute;
            this.m_originalTitle = this.Title;
            XmlNode firstChild = this.LinkElement.FirstChild;

            if (firstChild == null || !(firstChild.Name == "Image") || firstChild.FirstChild == null)
            {
                return;
            }
            ImageSet imageSet = ImageSet.FromXml(this.Manager.Resources, firstChild.FirstChild as XmlElement);

            this.SetValue(XmlQuickLink.ImageProperty, (object)imageSet["Focus"]);
            this.SetValue(XmlQuickLink.NonFocusImageProperty, (object)imageSet["Default"]);
        }