Esempio n. 1
0
 internal override void Save(IResourceLibrary ehres)
 {
     foreach (StartMenuObject startMenuObject in (Collection <IQuickLink>) this.quickLinks)
     {
         startMenuObject.Save(ehres);
     }
     MediaCenterUtil.SaveXmlResource(ehres, this.DocumentResourceName, 23, this.xml);
     base.Save(ehres);
 }
Esempio n. 2
0
 public virtual void Save(IResourceLibraryCache cache, bool forceSave)
 {
     try
     {
         if (!this.IsDirty && !forceSave)
         {
             return;
         }
         this.OnSaving(EventArgs.Empty);
         IResourceLibrary resourceLibrary = cache["ehres.dll"];
         this.SaveInternal(resourceLibrary);
         List <XmlNode> list = new List <XmlNode>();
         foreach (XmlElement element in this.StripParentNode.ChildNodes)
         {
             int index;
             if (this.IsOemPlaceholderElement(element, out index))
             {
                 list.Add((XmlNode)element);
             }
         }
         foreach (XmlNode oldChild in list)
         {
             this.StripParentNode.RemoveChild(oldChild);
         }
         int index1 = 0;
         foreach (IMenuStrip menuStrip in (Collection <IMenuStrip>) this.managerStrips)
         {
             BaseXmlMenuStrip strip1 = menuStrip as BaseXmlMenuStrip;
             if (strip1 != null)
             {
                 if (strip1.StartMenuElement.ParentNode != null)
                 {
                     strip1.StartMenuElement.ParentNode.RemoveChild((XmlNode)strip1.StartMenuElement);
                 }
                 this.StripParentNode.AppendChild(this.GetNodeForSave(strip1));
                 strip1.Save(resourceLibrary);
             }
             else
             {
                 OemMenuStrip strip2 = menuStrip as OemMenuStrip;
                 if (strip2 != null)
                 {
                     strip2.TimeStamp = int.MaxValue - index1;
                     this.StripParentNode.AppendChild(this.CreateOemStripNode(strip2, index1));
                     ++index1;
                 }
             }
         }
         int customStripCount;
         for (customStripCount = this.MinCustomStripCount; index1 < customStripCount; ++index1)
         {
             this.StripParentNode.AppendChild(this.CreateOemStripNode((OemMenuStrip)null, index1));
         }
         this.UpdateOemStripCount(customStripCount);
         if (this.oemManager != null)
         {
             this.oemManager.Save();
         }
         MediaCenterUtil.SaveXmlResource(resourceLibrary, "STARTMENU.XML", 23, this.StartMenuDocument);
         this.IsDirty = false;
     }
     finally
     {
         this.OnSaved(EventArgs.Empty);
     }
 }