コード例 #1
0
        private void btnConnect_Click(object sender, EventArgs e)
        {
            string lokinetExeString;

            if (Program.platform == PlatformID.Win32NT)
            {
                lokinetExeString = String.Format("{0}\\lokinet.exe", Directory.GetCurrentDirectory());
            }
            else
            {
                lokinetExeString = String.Format("{0}/lokinet", Directory.GetCurrentDirectory());
            }

            lokiNetDaemon.StartInfo.UseShellExecute        = false;
            lokiNetDaemon.StartInfo.RedirectStandardOutput = true;
            //lokiNetDaemon.EnableRaisingEvents = true;
            lokiNetDaemon.StartInfo.CreateNoWindow = true;
            lokiNetDaemon.StartInfo.FileName       = lokinetExeString;
            lokiNetDaemon.Start();
            lokiNetDaemon.BeginOutputReadLine();
            btnConnect.Enabled        = false;
            TrayConnect.Enabled       = false;
            StatusLabel.Text          = "Connected";
            isConnected               = true;
            NotificationTrayIcon.Text = "LokiNET - connected";
            btnDrop.Enabled           = true;
            TrayDisconnect.Enabled    = true;
            NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Connected to network.", ToolTipIcon.Info);
        }
コード例 #2
0
 private void btnHide_Click(object sender, EventArgs e)
 {
     Hide();
     if (isConnected)
     {
         NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Currently connected.", ToolTipIcon.Info);
     }
     else
     {
         NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Currently disconnected.", ToolTipIcon.Info);
     }
 }
コード例 #3
0
 private void btnDrop_Click(object sender, EventArgs e)
 {
     lokiNetDaemon.CancelOutputRead();
     lokiNetDaemon.Kill();
     btnConnect.Enabled        = true;
     TrayConnect.Enabled       = true;
     btnDrop.Enabled           = false;
     TrayDisconnect.Enabled    = false;
     StatusLabel.Text          = "Disconnected";
     NotificationTrayIcon.Text = "LokiNET - disconnected";
     isConnected       = false;
     logText           = lokinetd_fd1.Text;
     lokinetd_fd1.Text = string.Empty;
     NotificationTrayIcon.ShowBalloonTip(5, "LokiNET", "Disconnected from network.", ToolTipIcon.Info);
 }