void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) { P2PVPNForm form = MainForm as P2PVPNForm; //My derived form type //form.LoadFile(e.CommandLine[1]); if (e.CommandLine.Count() >= 2) { string sourceDir = ""; for (int i = 1; i < e.CommandLine.Count(); i++) { sourceDir += e.CommandLine[i] + " "; } sourceDir = sourceDir.Trim(); Settings settings = Settings.Get(); if (!string.IsNullOrWhiteSpace(settings.ExcludedFolderFromMediaTransfer)) { if (sourceDir.Contains(settings.ExcludedFolderFromMediaTransfer)) { return; } } form.bwTorrentDownloadComplete.RunWorkerAsync(sourceDir); } //else if (e.CommandLine.Count() == 3) //{ // string sourceDir = e.CommandLine[1] +" " + e.CommandLine[2]; // form.bwTorrentDownloadComplete.RunWorkerAsync(sourceDir); //} e.BringToForeground = true; }
protected override void OnCreateMainForm() { MainForm = new P2PVPNForm(); }