Example #1
0
 private void MacIn_LostFocus(object sender, RoutedEventArgs e)
 {
     if (MacIn.Text.Trim() != "")
     {
         MAC NewMAC;
         if (MAC.TryParse(MacIn.Text, out NewMAC))
         {
             a.MyMACAddress = NewMAC;
             parent.UpdateView();
         }
         else
         {
             MacIn.Text = "Error Parsing data current MAC: " + a.MyMACAddress.ToString();
         }
     }
 }
Example #2
0
        private void tbSourceAddr_TextChanged(object sender, EventArgs e)
        {
            if (mode == Mode.InputData)
            {
                ClearFCS();
            }

            TextBox tb = sender as TextBox;
            string  errorMessage;
            MAC     mac;

            errorProvider1.SetError(tb, "");
            this.Frame.SourceMac = null;

            if (!MAC.TryParse(tb.Text, out errorMessage, out mac))
            {
                errorProvider1.SetError(tb, errorMessage);
            }
            else
            {
                this.Frame.SourceMac = mac;
            }
        }