Example #1
0
        public void NewFileDownload(string url, string fn, bool modal, bool dialog = true)
        {
            if (modal)
            {
                if (dialog == false)
                {
                    using (NewDownloadForm newDownload = new NewDownloadForm())
                    {
                        if (!String.IsNullOrEmpty(url))
                        {
                            newDownload.DownloadLocation = ResourceLocation.FromURL(url);
                            newDownload.LocalFile        = fn;
                        }

                        newDownload.Show();
                    }
                }
                else
                {
                    using (NewDownloadDialog newDownload = new NewDownloadDialog())
                    {
                        if (!String.IsNullOrEmpty(url))
                        {
                            newDownload.DownloadLocation = ResourceLocation.FromURL(url);
                            newDownload.LocalFile        = fn;
                        }

                        newDownload.ShowDialog();
                    }
                }
            }
            else
            {
                NewDownloadForm newDownload = new NewDownloadForm();

                if (!String.IsNullOrEmpty(url))
                {
                    newDownload.DownloadLocation = ResourceLocation.FromURL(url);
                    newDownload.LocalFile        = fn;
                }

                newDownload.ShowInTaskbar = true;
                newDownload.MinimizeBox   = true;
                newDownload.Show();
                newDownload.Focus();
                newDownload.TopMost = true;
            }
        }
Example #2
0
        public void NewFileDownload(string url, string fn, bool modal, bool dialog = true)
        {
            if (modal)
            {
                if (dialog == false)
                {
                    using (NewDownloadForm newDownload = new NewDownloadForm())
                    {
                        if (!String.IsNullOrEmpty(url))
                        {
                            newDownload.DownloadLocation = ResourceLocation.FromURL(url);
                            newDownload.LocalFile = fn;
                        }

                        newDownload.Show();
                    }
                }
                else
                {
                    using (NewDownloadDialog newDownload = new NewDownloadDialog())
                    {
                        if (!String.IsNullOrEmpty(url))
                        {
                            newDownload.DownloadLocation = ResourceLocation.FromURL(url);
                            newDownload.LocalFile = fn;
                        }

                        newDownload.ShowDialog();
                    }
                }
            }
            else
            {
                NewDownloadForm newDownload = new NewDownloadForm();

                if (!String.IsNullOrEmpty(url))
                {
                    newDownload.DownloadLocation = ResourceLocation.FromURL(url);
                    newDownload.LocalFile = fn;
                }

                newDownload.ShowInTaskbar = true;
                newDownload.MinimizeBox = true;
                newDownload.Show();
                newDownload.Focus();
                newDownload.TopMost = true;
            }
        }