Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Username = txtUsername.Text;
            Ip = ipAddress.IPAddress;
            MacAddrConvertable macVariable = new MacAddrConvertable();
            macVariable.Address = macMac.Text;
            Mac = macVariable.ConvertToPhysicalAddress();

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Exemplo n.º 2
0
        private void frmEditIp_Load(object sender, EventArgs e)
        {
            txtUsername.Text = Username;
            if (Mac != null)
            {
                MacAddrConvertable macVariable = new MacAddrConvertable(Mac.GetAddressBytes());
                macMac.Text = macVariable.Address;
            }
            if (Ip != null)
                ipAddress.IPAddress = Ip;

            if (EditMode == false)
                btnAdd.Text = "Přidat";
        }
Exemplo n.º 3
0
 private PhysicalAddress GetChosenMac()
 {
     if (radioClient.Checked)
     {
         MacAddrConvertable macVariable = new MacAddrConvertable();
         macVariable.Address = macClient.Text;
         return macVariable.ConvertToPhysicalAddress();
     }
     else if (radioPTP.Checked)
     {
         MacAddrConvertable macVariable = new MacAddrConvertable();
         macVariable.Address = macRouterPTP.Text;
         return macVariable.ConvertToPhysicalAddress();
     }
     else if (radioSwitch.Checked)
     {
         return null;
     }
     else if (radioTransparentRouter.Checked)
     {
         MacAddrConvertable macVariable = new MacAddrConvertable();
         macVariable.Address = macRouter.Text;
         return macVariable.ConvertToPhysicalAddress();
     }
     else
         throw new Exception("Not any of options");
 }