protected virtual XmlNode GetNodeForSave(BaseXmlMenuStrip strip) { return((XmlNode)strip.StartMenuElement); }
protected override XmlNode GetNodeForSave(BaseXmlMenuStrip strip) { Windows7MenuStrip windows7MenuStrip = strip as Windows7MenuStrip; if (windows7MenuStrip == null || windows7MenuStrip.IsEnabled) return base.GetNodeForSave(strip); else return (XmlNode)strip.StartMenuElement.OwnerDocument.CreateComment(strip.StartMenuElement.OuterXml); }
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); } }