static void Main(string[] args) { var options = new Options(); if (CommandLine.Parser.Default.ParseArguments(args, options)) { try { var downloader = new IconDownloader(options.Path, options.Folder, options.Username, options.Logging); downloader.DoWork().Wait(); Console.WriteLine("Done...Exiting"); Console.ReadKey(); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Exiting..."); } } else { // Display the default usage information Console.WriteLine(options.GetUsage()); } }
public virtual void Awake() { _instance = this; m_downLoader = new Downloader(); m_assetLoader = new AssetDownloader(); m_iconLoader = new IconDownloader(); m_downLoader.Init(); m_assetLoader.Init(); m_iconLoader.Init(); MsgHandler.Instance.Init(); //m_servers.Add(MsgCenter._instance.WWWURL); }
public DownloadIconViewModel(Window window) { var downloader = new IconDownloader(); if (downloader.RequiredDownloadCount == 0) { MessageBox.Show("キャラアイコンはすべて揃っています。\n不足している場合、先にデータベースの更新を行ってください。"); window.Close(); return; } DownloadNum = new ReactiveProperty <int>(); DownloadNum.Value = downloader.RequiredDownloadCount; DownloadCompleteNum = new ReactiveProperty <int>(); downloader.OnCompleteDownload += () => { DownloadCompleteNum.Value++; if (DownloadCompleteNum.Value >= DownloadNum.Value) { Database.I.RefreshUnitIcons(); if (isFailed) { MessageBox.Show("一部アイコンのダウンロードに失敗しました。再度アイコン更新を行ってください。\nダウンロードに成功したアイコンを適用するにはこのソフトを再起動してください。"); } else { MessageBox.Show("アイコンのダウンロードが完了しました。\nこのソフトを再起動してください。"); } window.Close(); } }; downloader.OnFailedDonwload += () => { isFailed = true; }; DownloadNum.AddTo(m_Disposables); downloader.DownloadIcons(); }