Exemplo n.º 1
0
 protected override void SaveInternal(IResourceLibrary ehres)
 {
     MediaCenterUtil.StripChildComments(this.StripParentNode);
     foreach (Windows7MenuStrip windows7MenuStrip in this.m_deletedStrips)
     {
         XmlElement startMenuElement = windows7MenuStrip.StartMenuElement;
         if (startMenuElement.ParentNode != null)
         {
             startMenuElement.ParentNode.RemoveChild((XmlNode)startMenuElement);
         }
         this.StartMenuDocument.DocumentElement.RemoveAttribute(string.Format("xmlns:{0}", (object)windows7MenuStrip.StartMenuNamespace));
         ResourceExtensions.Update(ehres.GetResource(windows7MenuStrip.DocumentResourceName, (object)23), (byte[])null);
     }
     this.m_deletedStrips.Clear();
     base.SaveInternal(ehres);
 }
Exemplo n.º 2
0
        internal override void Save(IResourceLibrary ehres)
        {
            XmlNode quickLinksNode = this.QuickLinksNode;

            MediaCenterUtil.StripChildComments(quickLinksNode);
            foreach (XmlQuickLink xmlQuickLink in (Collection <IQuickLink>) this.QuickLinks)
            {
                XmlNode parentNode = xmlQuickLink.XmlElement.ParentNode;
                if (parentNode != null)
                {
                    try
                    {
                        parentNode.RemoveChild((XmlNode)xmlQuickLink.XmlElement);
                    }
                    catch (Exception)
                    {
                    }
                }
                bool flag = true;
                Windows7PartnerQuickLink partnerQuickLink = xmlQuickLink as Windows7PartnerQuickLink;
                if (partnerQuickLink != null)
                {
                    flag = partnerQuickLink.OemQuickLink != null;
                }
                if (flag)
                {
                    if (xmlQuickLink.IsEnabled)
                    {
                        quickLinksNode.AppendChild((XmlNode)xmlQuickLink.XmlElement);
                    }
                    else
                    {
                        XmlComment comment = this.MenuStripDocument.CreateComment(xmlQuickLink.XmlElement.OuterXml);
                        quickLinksNode.AppendChild((XmlNode)comment);
                    }
                }
            }
            if (this.Title != this.m_originalTitle)
            {
                this.StartMenuCategoryNode.Attributes["Description"].Value = this.Title;
            }
            base.Save(ehres);
        }