Ejemplo n.º 1
0
        private void mainWindow_ContentRendered(object sender, EventArgs e)
        {
            // In case the application was started from a web browser and receives command-line arguments
            if (args.Length == 2)
            {
                if (args[1].StartsWith("http"))
                {
                    System.Windows.Clipboard.SetText(args[1]);

                    NewDownload newDownloadDialog = new NewDownload(this);
                    newDownloadDialog.ShowDialog();
                }
            }
        }
Ejemplo n.º 2
0
        // This method is executed if you start the Seek process from an external application, e.g. a web browser which sends the URL of the file to download
        public bool SignalExternalCommandLineArgs(IList <string> args)
        {
            // Check if the command-line arguments were sent and if the NewDownload window is already open
            if ((args.Count == 2) && args[1].ToString().StartsWith("http") && !IsWindowAlreadyOpen(typeof(NewDownload)))
            {
                // The first argument args[0] contains the path to the Seek process
                // The second argument args[1] contains the URL of the file to download, which is set as text in the Clipboard
                Clipboard.SetText(args[1].ToString());

                // Open the Add New Download window and ensure it's on the top
                NewDownload newDownloadDialog = new NewDownload((MainWindow)Application.Current.MainWindow);
                newDownloadDialog.Topmost = true;
                newDownloadDialog.ShowDialog();
            }

            return(true);
        }
Ejemplo n.º 3
0
        private void btnNewDownload_Click(object sender, RoutedEventArgs e)
        {
            NewDownload newDownloadDialog = new NewDownload(this);

            newDownloadDialog.ShowDialog();
        }