Пример #1
0
        /// <summary>
        /// Get module download/update info from server.
        /// </summary>
        private bool GetUpdateInfo()
        {
            if (updates == null)
            {
                HttpHelper http = new HttpHelper();

                Stream stream;

                // but first check if updates.xml is available in system directory for debug purposes
                if (vfs.ExistsFile("updates.xml"))
                {
                    stream = vfs.GetFile("updates.xml", FileOpenMode.Read).Stream;
                }
                // otherwise download it
                else
                {
                    stream = http.DownloadFileToMemory(downloadLocation + "updates.xml");
                    if (stream == null)
                    {
                        // set to no connection
                        noConnection = true;
                        return(false);
                    }
                }

                updates = new BurntimeUpdateInfo(stream);
                stream.Close();
            }

            return(true);
        }