Exemplo n.º 1
0
        /// <summary>
        /// Writes the XML file for getting infos about updates.
        /// </summary>
        /// <param name="xmlFile">is the filename where to save the infos to.</param>
        public bool WriteUpdateXml(string xmlFile)
        {
            if (String.IsNullOrEmpty(xmlFile))
            {
                Console.WriteLine("[MpeMaker] Error: Output file for Update.xml is not specified in package.");
                return(false);
            }

            if (!Path.IsPathRooted(xmlFile))
            {
                xmlFile = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(this.ProjectSettings.ProjectFilename), xmlFile));
            }

            ExtensionCollection list = ExtensionCollection.Load(xmlFile);

            PackageClass pakToAdd = Clone();

            pakToAdd.GeneralInfo.OnlineLocation = ReplaceInfo(pakToAdd.GeneralInfo.OnlineLocation);
            pakToAdd.GeneralInfo.Params.Items.Remove(pakToAdd.GeneralInfo.Params[ParamNamesConst.ICON]);

            list.Add(pakToAdd);
            list.Sort(true);
            list.Save(xmlFile);

            return(true);
        }
 public static void Save()
 {
     if (!Directory.Exists(BaseFolder))
     {
         Directory.CreateDirectory(BaseFolder);
     }
     InstalledExtensions.Save(string.Format("{0}\\InstalledExtensions.xml", BaseFolder));
     KnownExtensions.Save(string.Format("{0}\\KnownExtensions.xml", BaseFolder));
 }
        private void add_list_Click(object sender, EventArgs e)
        {
            string xmlFile            = txt_list1.Text;
            ExtensionCollection list  = new ExtensionCollection();
            ExtensionCollection list2 = new ExtensionCollection();

            if (File.Exists(xmlFile))
            {
                list = ExtensionCollection.Load(xmlFile);
            }
            if (File.Exists(txt_list2.Text))
            {
                list2 = ExtensionCollection.Load(txt_list2.Text);
            }
            list.Add(list2);
            list.Save(xmlFile);
        }