Ejemplo n.º 1
0
 private void Reset(bool resetOem)
 {
     try
     {
         this.managerStrips.Clear();
         if (resetOem && this.oemManager != null)
         {
             this.oemManager.Reset();
         }
         IResourceLibrary resourceLibrary = this.Resources["ehres.dll"];
         XmlReader        xmlResource     = MediaCenterUtil.GetXmlResource(resourceLibrary, "STARTMENU.XML", 23);
         if (xmlResource != null)
         {
             this.startMenuXml = new XmlDocument();
             this.startMenuXml.Load(xmlResource);
             List <IMenuStrip> list       = new List <IMenuStrip>();
             XmlNodeList       childNodes = this.StripParentNode.ChildNodes;
             for (int index1 = 0; index1 < childNodes.Count; ++index1)
             {
                 IMenuStrip menuStrip = (IMenuStrip)null;
                 XmlElement element   = childNodes[index1] as XmlElement;
                 int        index2;
                 if (element != null && this.IsOemPlaceholderElement(element, out index2) && index2 >= 0)
                 {
                     if (index2 < this.MaxCustomStripCount)
                     {
                         if (this.oemManager != null && index2 < this.oemManager.StartMenuStrips.Count)
                         {
                             menuStrip = (IMenuStrip)this.oemManager.StartMenuStrips[index2];
                         }
                         else
                         {
                             continue;
                         }
                     }
                     else
                     {
                         Trace.WriteLine(string.Format("OEM strip element has index of {0}, which is over the max strip count of {1}.", (object)index2, (object)this.MaxCustomStripCount));
                     }
                 }
                 if (menuStrip == null)
                 {
                     menuStrip = this.CreateMenuStrip(childNodes[index1], resourceLibrary);
                 }
                 if (menuStrip != null)
                 {
                     if (element == null)
                     {
                         XmlMenuStrip xmlMenuStrip = menuStrip as XmlMenuStrip;
                         if (xmlMenuStrip != null)
                         {
                             XmlElement startMenuElement = xmlMenuStrip.StartMenuElement;
                         }
                     }
                     list.Add(menuStrip);
                 }
             }
             foreach (IMenuStrip menuStrip in list)
             {
                 this.managerStrips.Add(menuStrip);
             }
             this.managerStrips.Add((IMenuStrip) new OemCategoryStrip(this, "Auto Play (Blu-ray)", new string[1]
             {
                 "AutoPlay\\Blu-ray"
             }));
             this.managerStrips.Add((IMenuStrip) new OemCategoryStrip(this, "Auto Play (HD DVD)", new string[1]
             {
                 "AutoPlay\\HD DVD"
             }));
         }
         else
         {
             Trace.TraceWarning("Could not find STARTMENU.XML in ehres.dll!");
         }
         this.IsDirty = false;
     }
     finally
     {
         this.Resources.Clear();
     }
 }
Ejemplo n.º 2
0
 public XmlQuickLinkCollection(XmlMenuStrip strip)
 {
     this.strip  = strip;
     this.inInit = false;
 }