Exemplo n.º 1
0
        /// <summary>
        /// Modを更新します。
        /// </summary>
        public void Update()
        {
            try
            {
                if (matchedWebModInfo != null)
                {
                    var tempPath = Path.GetTempFileName();
#if DEBUG
                    WebManager.Instance.DownloadFile(matchedWebModInfo, tempPath, @"http://projectdxxx.me");
#else
                    WebManager.Instance.DownloadFile(matchedWebModInfo, tempPath);
#endif

                    if (File.Exists(tempPath))
                    {
                        File.Copy(tempPath, ModPath, true);
                        UpdateInfo();
                        matchedWebModInfoDetail = UpdateCanUpdate(matchedWebModInfo);
                    }
                }
            }
            catch
            {
            }
            finally
            {
                OnUpdateFinished();
            }
        }
Exemplo n.º 2
0
 private void UpdateCanUpdate(WebModInfo[] infos)
 {
     foreach (var info in infos)
     {
         matchedWebModInfoDetail = UpdateCanUpdate(info);
         if (matchedWebModInfoDetail != null)
         {
             matchedWebModInfo = info;
             break;
         }
     }
 }