Exemplo n.º 1
0
        private static List <UpdateListInfo.FileInfo> ReadFiles(XmlElement element)
        {
            var files    = new List <UpdateListInfo.FileInfo>();
            var nodeList = element.SelectNodes("/AutoUpdater/Files/File");

            if (nodeList != null)
            {
                foreach (XmlNode node in nodeList)
                {
                    var file = new UpdateListInfo.FileInfo();
                    file.Ver  = new MSCSVersion(GetNodeAttr(node, "Ver", ""));
                    file.Name = GetNodeAttr(node, "Name", "");

                    files.Add(file);
                }
            }
            return(files);
        }
Exemplo n.º 2
0
        public void MergeUpdateFiles(IEnumerable <UpdateFileInfo> updateFiles)
        {
            foreach (var file in updateFiles)
            {
                var found = this.Files.Find(x => x.Name == file.RelativePath);
                if (found != null)
                {
                    found.Ver = found.Ver.Increase();
                }
                else
                {
                    var newFile = new UpdateListInfo.FileInfo();
                    newFile.Name = file.RelativePath;
                    newFile.Ver  = MSCSVersion.First();
                    this.Files.Add(newFile);
                }
            }

            this.Application.Version = this.Application.Version.Increase();
        }