internal NowPlayingStrip(StartMenuManager smm, XmlElement element) : base(smm, element) { this.BeginInit(); this.originalTitle = MediaCenterUtil.GetMagicString(this.Manager.Resources, "#SM.NowPlaying.Title", out this.titleResourceID); this.Title = this.originalTitle; NowPlayingStrip nowPlayingStrip = this; NowPlayingStrip.NowPlayingLinkCollection playingLinkCollection1 = new NowPlayingStrip.NowPlayingLinkCollection(); playingLinkCollection1.Add((IQuickLink) new NowPlayingQuickLink(smm)); NowPlayingStrip.NowPlayingLinkCollection playingLinkCollection2 = playingLinkCollection1; nowPlayingStrip.links = playingLinkCollection2; this.EndInit(); }
protected override void Load() { int resourceID; this.Title = MediaCenterUtil.GetMagicString(this.Manager.Resources, this.AppElement.GetAttribute("Title"), out resourceID); this.originalTitle = this.Title; string attribute = this.AppElement.GetAttribute("Visible"); this.IsEnabled = string.IsNullOrEmpty(attribute) || Convert.ToBoolean(attribute); XmlNodeList childNodes = this.AppElement.ChildNodes; for (int index = 0; index < childNodes.Count; ++index) { XmlElement element = childNodes[index] as XmlElement; if (element != null) { IQuickLink quickLink = (IQuickLink)null; try { quickLink = !(element.Name == "home:PackageMarkupQuickLink") ? (!(element.Name == "home:PartnerQuickLink") ? (IQuickLink) new DefaultQuickLink(this.Manager, element) : (IQuickLink) new DefaultPartnerQuickLink(this.Manager, element)) : (IQuickLink) new DefaultPackageQuickLink(this.Manager, element); } catch (Exception ex) { Trace.TraceWarning("Failed to load link. Exception is:\n{0}\nXml for element is:\n{0}", (object)((object)ex).ToString(), (object)element.OuterXml); } if (quickLink != null) { quickLink.BeginInit(); int result; if (int.TryParse(element.GetAttribute("Priority"), out result)) { quickLink.Priority = result; this.QuickLinks.Add(quickLink); } quickLink.EndInit(); } } } }