Ejemplo n.º 1
0
 private void Forward_Connect()
 {
     if (!string.IsNullOrEmpty(dialog_username.Text) || !string.IsNullOrEmpty(dialog_password.Password))
     {
         VPN_Controller.OpenConnection(VPN_Name, dialog_username.Text, dialog_password.Password);
         this.Close();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="entry"></param>
        private void Connect(object entry)
        {
            if (entry is VPN vpn)
            {
                vpn.Status = VPN_Controller.CheckConnection(vpn.Name);
                if (vpn.Status)
                {
                    VPN_Controller.CloseConnection(vpn.Name);
                }
                else
                {
                    VPN_Controller.OpenConnection(vpn.Name, "", "");
                }
                vpn.Image  = (BitmapImage)Change_Entry_Icon(vpn.Image, vpn.Status);
                vpn.Status = VPN_Controller.CheckConnection(vpn.Name);
            }

            if (entry is MenuItem item)
            {
                //Change_Entry_Icon(item);
            }
        }