Beispiel #1
0
        private bool                    LoadCached()
        {
            String cacheFilePath = GetCacheFilePath();

            if (!File.Exists(cacheFilePath))
            {
                return(false);
            }

            XmlDocument xml = new XmlDocument();

            try
            {
                xml.Load(cacheFilePath);
                ParseXml(xml);
            }
            catch (System.Exception a_Exception)
            {
                // Don't nag user if cached file is bad
                System.Diagnostics.Debug.WriteLine(a_Exception.Message);
                return(false);
            }

            // Cached data is always loaded. That helps if update fails, and while it's still working.
            // Outposts don't change so often, and even if they do, it's not too important.
            return(!EveApi.IsCacheExpired(xml));
        }
Beispiel #2
0
        private Boolean LoadAssetsXml(string a_FilePath, bool a_TestCacheDate)
        {
            if (!File.Exists(a_FilePath))
            {
                return(false);
            }

            XmlDocument assetsXml = new XmlDocument();

            assetsXml.Load(a_FilePath);

            if (a_TestCacheDate && EveApi.IsCacheExpired(assetsXml))
            {
                if (DialogResult.No != MessageBox.Show("Your assets information expired. Would you like to update now?\nWARNING: Due to CCP limitations, you can only update assets once every 7 hours.", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                    return(false);
                }
            }

            ParseAssetsXML(assetsXml);
            return(true);
        }