コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mloispro/P2PVpn
 protected override void OnCreateMainForm()
 {
     MainForm = new P2PVPNForm();
 }
コード例 #3
0
 protected override void OnCreateMainForm()
 {
     MainForm = new P2PVPNForm();
 }