Exemplo n.º 1
0
        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked)
            {
                if (IPAddressStart.Text != addressExampleText)
                {
                    textBefore = IPAddressStart.Text;
                }

                IPAddressStart.Focus();

                var start = localIP.Split('.').Select(str => Convert.ToInt32(str)).ToArray();
                var end   = localIP.Split('.').Select(str => Convert.ToInt32(str)).ToArray();
                start[3] = 1;
                end[3]   = 255;
                string lanRange = string.Join(".", start.Select(num => num.ToString())) + " - " + string.Join(".", end.Select(num => num.ToString()));

                IPAddressStart.Text = lanRange;
                ScanStart.Focus();
            }
            else
            {
                IPAddressStart.Focus();
                IPAddressStart.Text = textBefore;
                ScanStart.Focus();
            }
        }
Exemplo n.º 2
0
 public void ScanArray()
 {
     ScanStart?.Invoke(this, EventArgs.Empty);
     for (var i = 0; i < numbers.Length; i++)
     {
         if (numbers[i] % 2 == 1)
         {
             var args = new OddNumberEventArgs(numbers[i]);
             IterateOdd?.Invoke(this, args);
             if (args.CancelRequested)
             {
                 break;
             }
         }
     }
     ScanDone?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 3
0
 internal void RaiseScanStartEvent(ScanStartEventArgs e)
 {
     ScanStart?.Invoke(this, e);
 }