Esempio n. 1
0
        public void BeginCheck()
        {
            var worker  = new BackgroundWorker();
            var version = "";

            worker.DoWork += (o, e) =>
            {
                try
                {
                    var xDoc = new XmlDocument();
                    xDoc.Load(new XmlTextReader(updateXMLUrl));

                    version = xDoc.SelectSingleNode("//version").InnerText;
                }
                catch (Exception ex)
                {
                    Log.Error("Error checking for updates", ex);
                }
            };

            worker.RunWorkerCompleted += (o, e) => { _window.ToggleUpdateMenu(version); };

            worker.RunWorkerAsync();
        }