예제 #1
0
        private void MnuActionDownload_Click(object sender, EventArgs e)
        {
            var listItems = lvDownload.Items;

            if (listItems.Count == 0)
            {
                return;
            }

            if (_downloadConfig == null)
            {
                const string message = "You are trying to download assets according to a local manifest. You can only perform this when you know the exact details of the manifest (resource version, engine version, platform info, etc.) otherwise it always fails.\nAgain, only proceed if you understand exactly what you are doing. Do you want to continue?";
                var          r       = MessageBox.Show(message, ApplicationHelper.GetApplicationTitle(), MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                if (r == DialogResult.No)
                {
                    return;
                }
            }

            var items = new TreeListItem[listItems.Count];

            for (var i = 0; i < items.Length; i += 1)
            {
                items[i] = listItems[i].Tag as TreeListItem;
            }

            using (var f = new FAssetDownload(items, _downloadConfig)) {
                f.ShowDialog(this);
            }
        }
예제 #2
0
            public WorkerThread([NotNull] FAssetDownload form, [NotNull] DownloadConfig downloadConfig, [NotNull] string saveDir)
            {
                _form           = form;
                _downloadConfig = downloadConfig;
                _saveDir        = saveDir;

                _thread              = new Thread(DoWork);
                _thread.Name         = "Asset Download Worker";
                _thread.IsBackground = true;
            }