Example #1
0
        public DownloadWindowViewModel(DownloadWindow parent, string url, string name, string destination)
        {
            _parent       = parent;
            _url          = url;
            _downloadName = name;
            _destination  = destination;

            Start();
        }
Example #2
0
        internal string Download()
        {
            if (!Directory.Exists(Consts.ModListDownloadFolder))
            {
                Directory.CreateDirectory(Consts.ModListDownloadFolder);
            }

            string dest = Path.Combine(Consts.ModListDownloadFolder, SelectedModList.Links.MachineURL + ExtensionManager.Extension);

            var window = new DownloadWindow(SelectedModList.Links.Download, SelectedModList.Title, dest);

            window.ShowDialog();

            if (window.Result == DownloadWindow.WindowResult.Completed)
            {
                return(dest);
            }
            return(null);
        }