示例#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();
                }
            }
        }
示例#2
0
        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", StringComparison.OrdinalIgnoreCase))
                {
                    Clipboard.SetText(args[1]);

                    var newDownloadDialog = new NewDownload(this);
                    newDownloadDialog.ShowDialog();
                }
            }
        }
示例#3
0
        // This method is executed if you start the SGet 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 SGet 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);
        }
示例#4
0
文件: App.xaml.cs 项目: yknx4/SGet
        // This method is executed if you start the SGet 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 SGet 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;
        }
示例#5
0
        private void btnNewDownload_Click(object sender, RoutedEventArgs e)
        {
            NewDownload newDownloadDialog = new NewDownload(this);

            newDownloadDialog.ShowDialog();
        }
示例#6
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();
                }
            }
        }
示例#7
0
 private void btnNewDownload_Click(object sender, RoutedEventArgs e)
 {
     NewDownload newDownloadDialog = new NewDownload(this);
     newDownloadDialog.ShowDialog();
 }